diff --git a/.bumpversion.cfg b/.bumpversion.cfg index a988bbb4d51..1b09bcdce3a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -11,8 +11,6 @@ replace = {new_version} [bumpversion:file:discovery/README.md] -[bumpversion:file:language-translator/README.md] - [bumpversion:file:natural-language-understanding/README.md] [bumpversion:file:speech-to-text/README.md] diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 6648074ea50..426617a7ac9 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -32,8 +32,6 @@ jobs: # continue-on-error: true env: MVN_ARGS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' - LANGUAGE_TRANSLATOR_APIKEY: ${{ secrets.LT_APIKEY }} - LANGUAGE_TRANSLATOR_URL: "https://api.us-south.language-translator.watson.cloud.ibm.com" NATURAL_LANGUAGE_UNDERSTANDING_APIKEY: ${{ secrets.NLU_APIKEY }} NATURAL_LANGUAGE_UNDERSTANDING_URL: "https://api.us-south.natural-language-understanding.watson.cloud.ibm.com" SPEECH_TO_TEXT_APIKEY: ${{ secrets.STT_APIKEY }} @@ -46,10 +44,6 @@ jobs: ASSISTANT_WORKSPACE_ID: ${{ secrets.WA_WORKSPACE_ID }} ASSISTANT_ASSISTANT_ID: ${{ secrets.WA_ASSISTANT_ID }} ASSISTANT_URL: "https://api.us-south.assistant.watson.cloud.ibm.com" - DISCOVERY_APIKEY: ${{ secrets.D1_APIKEY }} - DISCOVERY_ENVIRONMENT_ID: ${{ secrets.D1_ENVIRONMENT_ID }} - DISCOVERY_COLLECTION_ID: ${{ secrets.D1_COLLECTION_ID }} - DISCOVERY_URL: "https://api.us-south.discovery.watson.cloud.ibm.com" DISCOVERY_V2_APIKEY: ${{ secrets.D2_APIKEY }} DISCOVERY_V2_PROJECT_ID: ${{ secrets.D2_PROJECT_ID }} DISCOVERY_V2_COLLECTION_ID: ${{ secrets.D2_COLLECTION_ID }} @@ -57,9 +51,7 @@ jobs: run: | mvn test -Dtest=v1/AssistantServiceIT -DfailIfNoTests=false -pl assistant,common $MVN_ARGS mvn test -Dtest=v2/AssistantServiceIT -DfailIfNoTests=false -pl assistant,common $MVN_ARGS - mvn test -Dtest=v1/DiscoveryServiceIT -DfailIfNoTests=false -pl discovery,common $MVN_ARGS mvn test -Dtest=v2/DiscoveryIT -DfailIfNoTests=false -pl discovery,common $MVN_ARGS - mvn test -Dtest=LanguageTranslatorIT -DfailIfNoTests=false -pl language-translator,common $MVN_ARGS mvn test -Dtest=NaturalLanguageUnderstandingIT -DfailIfNoTests=false -pl natural-language-understanding,common $MVN_ARGS mvn test -Dtest=SpeechToTextIT -DfailIfNoTests=false -pl speech-to-text,common $MVN_ARGS mvn test -Dtest=TextToSpeechIT -DfailIfNoTests=false -pl text-to-speech,common $MVN_ARGS diff --git a/MIGRATION-V11.md b/MIGRATION-V11.md deleted file mode 100644 index 98c20bc3cb1..00000000000 --- a/MIGRATION-V11.md +++ /dev/null @@ -1,50 +0,0 @@ -# v11.0.0 Migration Guide - -### Breaking changes by service - -#### Assistant v2 -- Model `MessageContext` property `skills` type changed to new `MessageContextSkills` -- Model `Environment` property `language` removed -- Model `EnvironmentReleaseReference` renamed to `BaseEnvironmentReleaseReference` -- Model `EnvironmentOrchestration` renamed to `BaseEnvironmentOrchestration` -- Model `SkillReference` renamed to `EnvironmentSkill` - -#### Discovery v2 -- Parameter `smartDocumentUnderstanding` removed from `CreateCollectionOptions` -- Model `QueryResponsePassage` and `QueryResultPassage` property `confidence` removed -- QueryAggregation models restructured - -#### Natural Language Understanding -- All `sentimentModel` functions removed - -#### Speech to Text -- `AR_AR_BROADBANDMODEL` model removed in favor of `AR_MS_BROADBANDMODEL` model - - -### New Features by Service - -#### Assistant v2 -- `createAssistant` function -- `listAssistants` function -- `deleteAssistant` function -- `updateEnvironment` function -- `createRelease` function -- `deleteRelease` function -- `getSkill` function -- `updateSkill` function -- `exportSkills` function -- `importSkills` function -- `importSkillsStatus` function -- Improved typing for `message` function call -See details of these functions on IBM's documentation site [here](https://cloud.ibm.com/apidocs/assistant-v2?code=node) - -#### Discovery v2 -- Aggregation types `QueryTopicAggregation` and `QueryTrendAggregation` added - -#### Speech to Text -- added `FR_CA_MULTIMEDIA`, `JA_JP_TELEPHONY`, `NL_NL_MULTIMEDIA`, `SV_SE_TELEPHONY` models - -#### Text to Speech -- added `EN_AU_HEIDIEXPRESSIVE`, `EN_AU_JACKEXPRESSIVE`, `EN_US_ALLISONEXPRESSIVE`, `EN_US_EMMAEXPRESSIVE`, `EN_US_LISAEXPRESSIVE`, `EN_US_MICHAELEXPRESSIVE`, `KO_KR_JINV3VOICE` -- Parameters `ratePercentage` and `pitchPercentage` added to `synthesize` function -See details of these new parameters on IBM's documentation site [here](https://cloud.ibm.com/apidocs/text-to-speech?code=node#synthesize) diff --git a/README.md b/README.md index 54df8eb7f38..68fe84f1974 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ The file downloaded will be called `ibm-credentials.env`. This is the name the S As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Discovery instance, you just need to do the following: ```java -Discovery service = new Discovery("2019-04-30"); +Discovery service = new Discovery("2023-03-31"); ``` And that's it! @@ -144,7 +144,7 @@ Builder pattern approach: Authenticator authenticator = new IamAuthenticator.Builder() .apikey("") .build(); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); ``` Deprecated constructor approach: @@ -152,7 +152,7 @@ Deprecated constructor approach: ```java // letting the SDK manage the IAM token Authenticator authenticator = new IamAuthenticator(""); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); ``` Supplying the access token: @@ -160,7 +160,7 @@ Supplying the access token: ```java // assuming control of managing IAM token Authenticator authenticator = new BearerTokenAuthenticator(""); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); ``` #### Username and password @@ -172,14 +172,14 @@ Authenticator authenticator = new BasicAuthenticator.Builder() .username("") .password("") .build(); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); ``` Deprecated constructor approach: ```java Authenticator authenticator = new BasicAuthenticator("", ""); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); ``` #### ICP @@ -187,7 +187,7 @@ Authenticating with ICP is similar to the basic username and password method, ex ```java Authenticator authenticator = new BasicAuthenticator("", ""); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); HttpConfigOptions options = new HttpConfigOptions.Builder() .disableSslVerification(true) @@ -210,7 +210,7 @@ Authenticator authenticator = new CloudPakForDataAuthenticator.Builder() .disableSSLVerification(true) .headers(null) .build(); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); service.setServiceUrl(""); ``` @@ -225,14 +225,14 @@ Authenticator authenticator = new CloudPakForDataAuthenticator( true, // disabling SSL verification null, ); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); service.setServiceUrl(""); ``` ```java // assuming control of managing the access token Authenticator authenticator = new BearerTokenAuthenticator(""); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); service.setServiceUrl(""); ``` @@ -288,7 +288,7 @@ Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", 8080 IamAuthenticator authenticator = new IamAuthenticator(apiKey); authenticator.setProxy(proxy); -Discovery service = new Discovery("2019-04-30", authenticator); +Discovery service = new Discovery("2023-03-31", authenticator); // setting configuration options HttpConfigOptions options = new HttpConfigOptions.Builder() diff --git a/RELEASE.md b/RELEASE.md index 4ec7e5ad18c..02e3e8a4a07 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -17,7 +17,7 @@ If things **don't** go smoothly, you'll need to follow some other instructions t The most common reason for a release to fail is because of a Travis timeout. Builds are only allowed to run for a maximum of 1 hour, and unfortunately the syncing process between Bintray and Maven Central can be slow enough to go over this time limit sometimes. If this happens, you should do the following: - Navigate to the code on Bintray at [this URL](https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo). If you're not a member of the ibm-cloud-sdks organization, ask the maintainer of this SDK repo for access. -- Navigate to the "Maven Central" tab in each of the packages that didn't sync. Here's an example: https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo/com.ibm.watson%3Alanguage-translator#central. You can figure out which packages to sync manually by checking the failed Travis build log or by looking at the "Last Synced" date for the package. +- Navigate to the "Maven Central" tab in each of the packages that didn't sync. Here's an example: https://bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo/com.ibm.watson%3Anatural-language-understanding#central. You can figure out which packages to sync manually by checking the failed Travis build log or by looking at the "Last Synced" date for the package. - Click the "Sync" button. If you need to provide Sonatype credentials, you can also ask the maintainer of this SDK repo for those. Bintray sync diff --git a/assistant/pom.xml b/assistant/pom.xml index 911a53cbdd1..5450d344495 100644 --- a/assistant/pom.xml +++ b/assistant/pom.xml @@ -36,6 +36,11 @@ testng test + + com.launchdarkly + okhttp-eventsource + 4.1.1 + com.squareup.okhttp3 mockwebserver diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java index 8856c8e6e5b..2c99bedb32f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/Assistant.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 + * IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 */ package com.ibm.watson.assistant.v1; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/AgentAvailabilityMessage.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/AgentAvailabilityMessage.java index 1bebda3b791..026d672a48e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/AgentAvailabilityMessage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/AgentAvailabilityMessage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOptions.java index f0aebfea000..b5634172827 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOutput.java index 2d7f5508b2a..791bdf2cc90 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyOutput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyResponse.java index b92455bcee7..30569021eac 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyUtterance.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyUtterance.java index 2a23484c201..76611d1f716 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyUtterance.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/BulkClassifyUtterance.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CaptureGroup.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CaptureGroup.java index ba7b7620462..939e5f580ac 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CaptureGroup.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CaptureGroup.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferInfo.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferInfo.java index ec8d97cc766..d5840b03af2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferInfo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferInfo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTarget.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTarget.java index 4d0a3b3d28f..eb7cb1078af 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTarget.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTarget.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTargetChat.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTargetChat.java index 8daa25e2578..a8641098311 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTargetChat.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ChannelTransferTargetChat.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Context.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Context.java index c1a748d045a..6b3c1d60a6c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Context.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Context.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -21,6 +22,8 @@ /** * State information for the conversation. To maintain state, include the context from the previous * response. + * + *

This type supports additional properties of type Object. Any context variable. */ public class Context extends DynamicModel { @@ -102,7 +105,7 @@ public Builder metadata(MessageContextMetadata metadata) { } /** - * Add an arbitrary property. + * Add an arbitrary property. Any context variable. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Counterexample.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Counterexample.java index f6395882b64..df36b2032fa 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Counterexample.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Counterexample.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CounterexampleCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CounterexampleCollection.java index 2ecabe732b1..2b07cced728 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CounterexampleCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CounterexampleCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateCounterexampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateCounterexampleOptions.java index b6576d773d3..27b3a9e92d4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateCounterexampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateCounterexampleOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java index 41e874dbffc..af160c90612 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateDialogNodeOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntity.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntity.java index f34cf57e12d..26146110516 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntity.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntity.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntityOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntityOptions.java index e74d3c4a147..b27c226a16b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntityOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateEntityOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateExampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateExampleOptions.java index 3597553a1a8..7aff2e8be35 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateExampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateExampleOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntent.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntent.java index 9e929b96a5d..3dae5e0730a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntent.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntentOptions.java index 16c250c77bf..a1e8d20e995 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateIntentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateSynonymOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateSynonymOptions.java index 954bb409832..5f645b90845 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateSynonymOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateSynonymOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValue.java index 64cbdcea173..75624523cf7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValue.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValueOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValueOptions.java index 98e5b354d2d..b184a4064c6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValueOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateValueOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceAsyncOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceAsyncOptions.java index 90996b4dd75..76cdc34ed63 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceAsyncOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceAsyncOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceOptions.java index c2a646f28e8..baa22d73fff 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/CreateWorkspaceOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteCounterexampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteCounterexampleOptions.java index e4e3e163130..bdaaa73d6a2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteCounterexampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteCounterexampleOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteDialogNodeOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteDialogNodeOptions.java index 9bf0bd6b3f3..ddd3bc396cc 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteDialogNodeOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteDialogNodeOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteEntityOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteEntityOptions.java index e37314d60ec..d6ddd677fee 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteEntityOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteEntityOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteExampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteExampleOptions.java index 40472e68f87..5599e588a58 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteExampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteExampleOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteIntentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteIntentOptions.java index 16ab640d39b..9394b8ae511 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteIntentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteIntentOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteSynonymOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteSynonymOptions.java index 80c52690c4f..f4bb375e6a3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteSynonymOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteSynonymOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteUserDataOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteUserDataOptions.java index 5c71ac85397..c53c1735afe 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteUserDataOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteUserDataOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteValueOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteValueOptions.java index cc85a130e0b..9338a62ac2e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteValueOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteValueOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteWorkspaceOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteWorkspaceOptions.java index 5fec8892a79..85d048abf77 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteWorkspaceOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DeleteWorkspaceOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java index a565fa1f5fc..b76dcc8ca40 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNode.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeAction.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeAction.java index 7001daf1ea1..7460443db77 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeAction.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeAction.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeCollection.java index 5430b2c3247..5b138fa9802 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeContext.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeContext.java index 9474235c3d1..281a6738ce2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeContext.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeContext.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -18,7 +19,11 @@ import java.util.HashMap; import java.util.Map; -/** The context for the dialog node. */ +/** + * The context for the dialog node. + * + *

This type supports additional properties of type Object. Any context variable. + */ public class DialogNodeContext extends DynamicModel { @SerializedName("integrations") @@ -67,7 +72,7 @@ public Builder integrations(Map> integrations) { } /** - * Add an arbitrary property. + * Add an arbitrary property. Any context variable. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeNextStep.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeNextStep.java index 6f8949fd681..9ef1cafb650 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeNextStep.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeNextStep.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutput.java index d906c530f05..2f49be9ea5c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutput.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -24,6 +25,9 @@ * The output of the dialog node. For more information about how to specify dialog node output, see * the * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses). + * + *

This type supports additional properties of type Object. Any additional data included in the + * dialog node output. */ public class DialogNodeOutput extends DynamicModel { @@ -120,7 +124,7 @@ public Builder modifiers(DialogNodeOutputModifiers modifiers) { } /** - * Add an arbitrary property. + * Add an arbitrary property. Any additional data included in the dialog node output. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputConnectToAgentTransferInfo.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputConnectToAgentTransferInfo.java index 0f34e32b42a..0ec868810d1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputConnectToAgentTransferInfo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputConnectToAgentTransferInfo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGeneric.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGeneric.java index 7603100f4e0..0dcac9e1e65 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGeneric.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGeneric.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2022. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -64,7 +65,6 @@ public class DialogNodeOutputGeneric extends GenericModel { discriminatorMapping.put( "video", DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.class); } - /** How a response is selected from the list, if more than one response is specified. */ public interface SelectionPolicy { /** sequential. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.java index af1e9c1558c..d217dc51fad 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeAudio.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer.java index 38ad6183d19..1b52182a23f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -75,9 +76,9 @@ public DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer build( } /** - * Adds an channels to channels. + * Adds a new element to channels. * - * @param channels the new channels + * @param channels the new element to be added * @return the DialogNodeOutputGenericDialogNodeOutputResponseTypeChannelTransfer builder */ public Builder addChannels(ResponseGenericChannel channels) { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.java index c10e4e4faec..ef1563daa0d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe.java index 7422d29faab..c89aa5abf81 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeIframe.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeImage.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeImage.java index 56bbc4afc34..ea268461887 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeImage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeImage.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeOption.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeOption.java index 9dcdb83d5b2..a83ebe08971 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeOption.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeOption.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypePause.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypePause.java index 13911106180..ae005273baf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypePause.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypePause.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill.java index 5d1245c39e7..49c046a5b8c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeSearchSkill.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeText.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeText.java index b9025cb20f3..d37ffd716c9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeText.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeText.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined.java index 100f0b48c03..f9524dd5b2e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeUserDefined.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.java index e4ec9a28cfb..51975ba1cb9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputGenericDialogNodeOutputResponseTypeVideo.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputModifiers.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputModifiers.java index 9bce4a05c4c..03ff8da2fa9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputModifiers.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputModifiers.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElement.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElement.java index dab274df95c..f5c0d073b1c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElement.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElement.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElementValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElementValue.java index bb9ba3b752e..c6d8c1d0372 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElementValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputOptionsElementValue.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputTextValuesElement.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputTextValuesElement.java index 23c323c8018..ba8d16b6a74 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputTextValuesElement.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeOutputTextValuesElement.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeVisitedDetails.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeVisitedDetails.java index cb6fb468bef..78d92f013cd 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeVisitedDetails.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogNodeVisitedDetails.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestion.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestion.java index a9def32ba6e..30b7a68c1b9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestion.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestion.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionValue.java index 376f3d4db29..3c5e1530df1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/DialogSuggestionValue.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Entity.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Entity.java index e4b3a2b4d0a..c753e9cb885 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Entity.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Entity.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2016, 2023. + * (C) Copyright IBM Corp. 2016, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityCollection.java index 93966cd54da..744c50c0a00 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMention.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMention.java index 27f71f8a934..a381eb16e49 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMention.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMention.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMentionCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMentionCollection.java index 6fbfb3b7c0f..8d31644fb15 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMentionCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/EntityMentionCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Example.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Example.java index c99929fb772..422e3a5cbea 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Example.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Example.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExampleCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExampleCollection.java index 66050326e7f..1b8e27a8fca 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExampleCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExampleCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExportWorkspaceAsyncOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExportWorkspaceAsyncOptions.java index 006be25def0..b9176939565 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExportWorkspaceAsyncOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ExportWorkspaceAsyncOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetCounterexampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetCounterexampleOptions.java index c232b2a77f5..d97e00dff21 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetCounterexampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetCounterexampleOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetDialogNodeOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetDialogNodeOptions.java index fe20549866d..3787e207644 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetDialogNodeOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetDialogNodeOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetEntityOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetEntityOptions.java index 3f9b12b7aa2..a1176c282a5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetEntityOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetEntityOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetExampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetExampleOptions.java index 6440f6fbee4..416bb3a5801 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetExampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetExampleOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetIntentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetIntentOptions.java index e7933b36e6b..358b9fbcc13 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetIntentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetIntentOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetSynonymOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetSynonymOptions.java index cf6b13c14f7..4bb883c447b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetSynonymOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetSynonymOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetValueOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetValueOptions.java index 4dfeaddcb4e..004815013fb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetValueOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetValueOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetWorkspaceOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetWorkspaceOptions.java index 352afeab117..636698cf092 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetWorkspaceOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/GetWorkspaceOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Intent.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Intent.java index 8b92cf4e604..c9d78bf9a3d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Intent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Intent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2016, 2023. + * (C) Copyright IBM Corp. 2016, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/IntentCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/IntentCollection.java index 38501ac31cd..aff2659db5b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/IntentCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/IntentCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListAllLogsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListAllLogsOptions.java index 61eb483bd94..f230f37b470 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListAllLogsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListAllLogsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListCounterexamplesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListCounterexamplesOptions.java index 98d2feb8c4d..923a6cf0e28 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListCounterexamplesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListCounterexamplesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListDialogNodesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListDialogNodesOptions.java index de85887e299..e0e379f240d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListDialogNodesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListDialogNodesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListEntitiesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListEntitiesOptions.java index 8f5833d2564..5bde74c0b60 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListEntitiesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListEntitiesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListExamplesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListExamplesOptions.java index fe74075671d..cb9c4d04abe 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListExamplesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListExamplesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListIntentsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListIntentsOptions.java index ba1f9467e4e..a022fe595f4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListIntentsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListIntentsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListLogsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListLogsOptions.java index d4968b16688..92e26d0d00f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListLogsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListLogsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListMentionsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListMentionsOptions.java index 14739a2fbb2..b2a5de946ec 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListMentionsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListMentionsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListSynonymsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListSynonymsOptions.java index d758ac53927..3c794bbbe0a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListSynonymsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListSynonymsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListValuesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListValuesOptions.java index bbd8a647d42..93d4ed90e18 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListValuesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListValuesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListWorkspacesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListWorkspacesOptions.java index 23f7401c9a5..14521421214 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListWorkspacesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ListWorkspacesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Log.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Log.java index 74e68e05b15..60faa6695c8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Log.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Log.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogCollection.java index 3a5de1b0c5e..741d5a7db9d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessage.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessage.java index 8fe228b23e9..6bfac0d0157 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessageSource.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessageSource.java index 224b85b449a..a1445839df5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessageSource.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogMessageSource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogPagination.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogPagination.java index bd28ed88af8..1abfdc2cf6f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogPagination.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/LogPagination.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Mention.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Mention.java index 0b8974fd1e5..f7dc287904a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Mention.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Mention.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageContextMetadata.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageContextMetadata.java index 82a94709cd8..c661adf3aab 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageContextMetadata.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageContextMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageInput.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageInput.java index 8f3791ef19b..af19308b244 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageInput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageInput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -18,7 +19,12 @@ import java.util.HashMap; import java.util.Map; -/** An input object that includes the input text. */ +/** + * An input object that includes the input text. + * + *

This type supports additional properties of type Object. Any additional data included with the + * message input. + */ public class MessageInput extends DynamicModel { @SerializedName("text") @@ -105,7 +111,7 @@ public Builder spellingAutoCorrect(Boolean spellingAutoCorrect) { } /** - * Add an arbitrary property. + * Add an arbitrary property. Any additional data included with the message input. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageOptions.java index 742b2726987..7f7ea15a2cd 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageRequest.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageRequest.java index c26998337ef..13907a4831e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageRequest.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageRequest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageResponse.java index e2eeae7a58b..bbee4e58033 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/MessageResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2016, 2023. + * (C) Copyright IBM Corp. 2016, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/OutputData.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/OutputData.java index da3df15b103..94bb544239c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/OutputData.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/OutputData.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -23,6 +24,9 @@ /** * An output object that includes the response to the user, the dialog nodes that were triggered, * and messages from the log. + * + *

This type supports additional properties of type Object. Any additional data included with the + * output. */ public class OutputData extends DynamicModel { @@ -190,7 +194,7 @@ public Builder generic(List generic) { } /** - * Add an arbitrary property. + * Add an arbitrary property. Any additional data included with the output. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Pagination.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Pagination.java index 667c87f4bb6..e0f8b841fa2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Pagination.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Pagination.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ResponseGenericChannel.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ResponseGenericChannel.java index a2d4d67443c..93d0c289c49 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ResponseGenericChannel.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ResponseGenericChannel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java index 2fd381a8ddf..52aacfbebd0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntity.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java index a9c44a85be3..eb7ce56abb3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityAlternative.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityInterpretation.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityInterpretation.java index f6711e962da..a4e654279bf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityInterpretation.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityInterpretation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityRole.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityRole.java index 62cbfa7bed9..9ffe6b84276 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityRole.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeEntityRole.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeIntent.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeIntent.java index aaf3a0eb328..c60fd8effc7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeIntent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeIntent.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGeneric.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGeneric.java index 6a18570cd40..c9d96256a51 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGeneric.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGeneric.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2022. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -54,7 +55,6 @@ public class RuntimeResponseGeneric extends GenericModel { "user_defined", RuntimeResponseGenericRuntimeResponseTypeUserDefined.class); discriminatorMapping.put("video", RuntimeResponseGenericRuntimeResponseTypeVideo.class); } - /** The preferred type of control to display. */ public interface Preference { /** dropdown. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java index 15ccf3688bd..927428615f7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java index 38983d48c95..4c110f4f96f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java index c423bcd8843..ed4198fcae2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java index 98962decdf0..b5e957ea026 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeImage.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeImage.java index c597df1f1ab..92932326b25 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeImage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeImage.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeOption.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeOption.java index 966aa633c6b..b087b49a816 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeOption.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeOption.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypePause.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypePause.java index dba2edbbb40..be94efe951a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypePause.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypePause.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java index 34a118ff063..d3554705d77 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeText.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeText.java index 33e8d51959a..af0a6ca0a55 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeText.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeText.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java index 2d81aed659b..ec17b5eee82 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java index ca52b98c46d..ce94e813f28 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import java.util.ArrayList; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/StatusError.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/StatusError.java index 6d6a81300bd..68a23b7e88d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/StatusError.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/StatusError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Synonym.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Synonym.java index 427cae9c51c..6860d79e61e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Synonym.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Synonym.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/SynonymCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/SynonymCollection.java index 1d08253b3ad..54f547936b8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/SynonymCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/SynonymCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateCounterexampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateCounterexampleOptions.java index 04487ae10b7..accef10adc3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateCounterexampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateCounterexampleOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java index 549fba21b2d..a0a29569b51 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateDialogNodeOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateEntityOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateEntityOptions.java index fb107317ff3..5adcc616330 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateEntityOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateEntityOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateExampleOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateExampleOptions.java index 1efae407ca7..8de7bd36e55 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateExampleOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateExampleOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateIntentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateIntentOptions.java index f62166a1c78..8a0247e3539 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateIntentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateIntentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateSynonymOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateSynonymOptions.java index 6713a5d2cc0..7af939d7037 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateSynonymOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateSynonymOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateValueOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateValueOptions.java index c425cf24855..40583789789 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateValueOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateValueOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceAsyncOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceAsyncOptions.java index 8874c404f97..fb6d5e2cb75 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceAsyncOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceAsyncOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceOptions.java index a46f6ab162e..a1c069de5f1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/UpdateWorkspaceOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Value.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Value.java index 92c00e7df7c..c5385865995 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Value.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Value.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ValueCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ValueCollection.java index 7c580f5117f..869b0a07027 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ValueCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/ValueCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Webhook.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Webhook.java index 6667fbd62c1..7a9efcf30b5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Webhook.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Webhook.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WebhookHeader.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WebhookHeader.java index 8224f1f2e9a..436bfb87b63 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WebhookHeader.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WebhookHeader.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Workspace.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Workspace.java index b6c48f4db0d..4fc9c506a78 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Workspace.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/Workspace.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCollection.java index 02b76e034ff..6c98c577cc4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2017, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCounts.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCounts.java index e57f27827bd..6545cf2d078 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCounts.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceCounts.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettings.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettings.java index 9f093fe8840..ccab1bbf8f6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettings.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettings.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; @@ -18,7 +19,11 @@ import java.util.HashMap; import java.util.Map; -/** Global settings for the workspace. */ +/** + * Global settings for the workspace. + * + *

This type supports additional properties of type Object. For internal use only. + */ public class WorkspaceSystemSettings extends DynamicModel { @SerializedName("tooling") @@ -179,7 +184,7 @@ public Builder nlp(WorkspaceSystemSettingsNlp nlp) { } /** - * Add an arbitrary property. + * Add an arbitrary property. For internal use only. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsDisambiguation.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsDisambiguation.java index e7804b6ffba..80f3d6c563d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsDisambiguation.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsDisambiguation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsNlp.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsNlp.java index 5968f9d50e4..ea83778cf94 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsNlp.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsNlp.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsOffTopic.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsOffTopic.java index 3e20794090f..f948dc2ecf3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsOffTopic.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsOffTopic.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsSystemEntities.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsSystemEntities.java index b1416063c6b..2cb0a99a5dc 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsSystemEntities.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsSystemEntities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsTooling.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsTooling.java index c2c69707d7a..b4e0484f734 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsTooling.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/model/WorkspaceSystemSettingsTooling.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v1/package-info.java b/assistant/src/main/java/com/ibm/watson/assistant/v1/package-info.java index 1fef121beba..2c201294c43 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v1/package-info.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v1/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,5 +10,6 @@ * 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. */ + /** Watson Assistant v1 v1. */ package com.ibm.watson.assistant.v1; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java index a5c66e1cfe4..edeaeea3ea6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/Assistant.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 + * IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 */ package com.ibm.watson.assistant.v2; @@ -30,6 +30,11 @@ import com.ibm.watson.assistant.v2.model.BulkClassifyOptions; import com.ibm.watson.assistant.v2.model.BulkClassifyResponse; import com.ibm.watson.assistant.v2.model.CreateAssistantOptions; +import com.ibm.watson.assistant.v2.model.CreateAssistantReleaseImportResponse; +import com.ibm.watson.assistant.v2.model.CreateProviderOptions; +import com.ibm.watson.assistant.v2.model.CreateReleaseExportOptions; +import com.ibm.watson.assistant.v2.model.CreateReleaseExportWithStatusErrors; +import com.ibm.watson.assistant.v2.model.CreateReleaseImportOptions; import com.ibm.watson.assistant.v2.model.CreateReleaseOptions; import com.ibm.watson.assistant.v2.model.CreateSessionOptions; import com.ibm.watson.assistant.v2.model.DeleteAssistantOptions; @@ -37,10 +42,12 @@ import com.ibm.watson.assistant.v2.model.DeleteSessionOptions; import com.ibm.watson.assistant.v2.model.DeleteUserDataOptions; import com.ibm.watson.assistant.v2.model.DeployReleaseOptions; +import com.ibm.watson.assistant.v2.model.DownloadReleaseExportOptions; import com.ibm.watson.assistant.v2.model.Environment; import com.ibm.watson.assistant.v2.model.EnvironmentCollection; import com.ibm.watson.assistant.v2.model.ExportSkillsOptions; import com.ibm.watson.assistant.v2.model.GetEnvironmentOptions; +import com.ibm.watson.assistant.v2.model.GetReleaseImportStatusOptions; import com.ibm.watson.assistant.v2.model.GetReleaseOptions; import com.ibm.watson.assistant.v2.model.GetSkillOptions; import com.ibm.watson.assistant.v2.model.ImportSkillsOptions; @@ -48,10 +55,16 @@ import com.ibm.watson.assistant.v2.model.ListAssistantsOptions; import com.ibm.watson.assistant.v2.model.ListEnvironmentsOptions; import com.ibm.watson.assistant.v2.model.ListLogsOptions; +import com.ibm.watson.assistant.v2.model.ListProvidersOptions; import com.ibm.watson.assistant.v2.model.ListReleasesOptions; import com.ibm.watson.assistant.v2.model.LogCollection; import com.ibm.watson.assistant.v2.model.MessageOptions; import com.ibm.watson.assistant.v2.model.MessageStatelessOptions; +import com.ibm.watson.assistant.v2.model.MessageStreamOptions; +import com.ibm.watson.assistant.v2.model.MessageStreamStatelessOptions; +import com.ibm.watson.assistant.v2.model.MonitorAssistantReleaseImportArtifactResponse; +import com.ibm.watson.assistant.v2.model.ProviderCollection; +import com.ibm.watson.assistant.v2.model.ProviderResponse; import com.ibm.watson.assistant.v2.model.Release; import com.ibm.watson.assistant.v2.model.ReleaseCollection; import com.ibm.watson.assistant.v2.model.SessionResponse; @@ -61,8 +74,10 @@ import com.ibm.watson.assistant.v2.model.StatefulMessageResponse; import com.ibm.watson.assistant.v2.model.StatelessMessageResponse; import com.ibm.watson.assistant.v2.model.UpdateEnvironmentOptions; +import com.ibm.watson.assistant.v2.model.UpdateProviderOptions; import com.ibm.watson.assistant.v2.model.UpdateSkillOptions; import com.ibm.watson.common.SdkCommon; +import java.io.InputStream; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -166,6 +181,138 @@ public void setVersion(final String version) { this.version = version; } + /** + * Create a conversational skill provider. + * + *

Create a new conversational skill provider. + * + * @param createProviderOptions the {@link CreateProviderOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a result of type {@link ProviderResponse} + */ + public ServiceCall createProvider(CreateProviderOptions createProviderOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + createProviderOptions, "createProviderOptions cannot be null"); + RequestBuilder builder = + RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/providers")); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "createProvider"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + contentJson.addProperty("provider_id", createProviderOptions.providerId()); + contentJson.add( + "specification", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(createProviderOptions.specification())); + contentJson.add( + "private", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(createProviderOptions.xPrivate())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List conversational skill providers. + * + *

List the conversational skill providers associated with a Watson Assistant service instance. + * + * @param listProvidersOptions the {@link ListProvidersOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a result of type {@link ProviderCollection} + */ + public ServiceCall listProviders(ListProvidersOptions listProvidersOptions) { + if (listProvidersOptions == null) { + listProvidersOptions = new ListProvidersOptions.Builder().build(); + } + RequestBuilder builder = + RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v2/providers")); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "listProviders"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (listProvidersOptions.pageLimit() != null) { + builder.query("page_limit", String.valueOf(listProvidersOptions.pageLimit())); + } + if (listProvidersOptions.includeCount() != null) { + builder.query("include_count", String.valueOf(listProvidersOptions.includeCount())); + } + if (listProvidersOptions.sort() != null) { + builder.query("sort", String.valueOf(listProvidersOptions.sort())); + } + if (listProvidersOptions.cursor() != null) { + builder.query("cursor", String.valueOf(listProvidersOptions.cursor())); + } + if (listProvidersOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(listProvidersOptions.includeAudit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * List conversational skill providers. + * + *

List the conversational skill providers associated with a Watson Assistant service instance. + * + * @return a {@link ServiceCall} with a result of type {@link ProviderCollection} + */ + public ServiceCall listProviders() { + return listProviders(null); + } + + /** + * Update a conversational skill provider. + * + *

Update a new conversational skill provider. + * + * @param updateProviderOptions the {@link UpdateProviderOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a result of type {@link ProviderResponse} + */ + public ServiceCall updateProvider(UpdateProviderOptions updateProviderOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + updateProviderOptions, "updateProviderOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("provider_id", updateProviderOptions.providerId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/providers/{provider_id}", pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "updateProvider"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + contentJson.add( + "specification", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateProviderOptions.specification())); + contentJson.add( + "private", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(updateProviderOptions.xPrivate())); + builder.bodyJson(contentJson); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + /** * Create an assistant. * @@ -391,6 +538,7 @@ public ServiceCall message(MessageOptions messageOption com.ibm.cloud.sdk.core.util.Validator.notNull(messageOptions, "messageOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("assistant_id", messageOptions.assistantId()); + pathParamsMap.put("environment_id", messageOptions.environmentId()); pathParamsMap.put("session_id", messageOptions.sessionId()); RequestBuilder builder = RequestBuilder.post( @@ -441,6 +589,7 @@ public ServiceCall messageStateless( messageStatelessOptions, "messageStatelessOptions cannot be null"); Map pathParamsMap = new HashMap(); pathParamsMap.put("assistant_id", messageStatelessOptions.assistantId()); + pathParamsMap.put("environment_id", messageStatelessOptions.environmentId()); RequestBuilder builder = RequestBuilder.post( RequestBuilder.resolveRequestUrl( @@ -475,6 +624,107 @@ public ServiceCall messageStateless( return createServiceCall(builder.build(), responseConverter); } + /** + * Send user input to assistant (stateful). + * + *

Send user input to an assistant and receive a streamed response, with conversation state + * (including context data) stored by watsonx Assistant for the duration of the session. + * + * @param messageStreamOptions the {@link MessageStreamOptions} containing the options for the + * call + * @return a {@link ServiceCall} with a result of type {@link InputStream} + */ + public ServiceCall messageStream(MessageStreamOptions messageStreamOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + messageStreamOptions, "messageStreamOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", messageStreamOptions.assistantId()); + pathParamsMap.put("environment_id", messageStreamOptions.environmentId()); + pathParamsMap.put("session_id", messageStreamOptions.sessionId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/environments/{environment_id}/sessions/{session_id}/message_stream", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v2", "messageStream"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "text/event-stream"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + if (messageStreamOptions.input() != null) { + contentJson.add( + "input", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(messageStreamOptions.input())); + } + if (messageStreamOptions.context() != null) { + contentJson.add( + "context", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(messageStreamOptions.context())); + } + if (messageStreamOptions.userId() != null) { + contentJson.addProperty("user_id", messageStreamOptions.userId()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getInputStream(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Send user input to assistant (stateless). + * + *

Send user input to an assistant and receive a response, with conversation state (including + * context data) managed by your application. + * + * @param messageStreamStatelessOptions the {@link MessageStreamStatelessOptions} containing the + * options for the call + * @return a {@link ServiceCall} with a result of type {@link InputStream} + */ + public ServiceCall messageStreamStateless( + MessageStreamStatelessOptions messageStreamStatelessOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + messageStreamStatelessOptions, "messageStreamStatelessOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", messageStreamStatelessOptions.assistantId()); + pathParamsMap.put("environment_id", messageStreamStatelessOptions.environmentId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/environments/{environment_id}/message_stream", + pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "messageStreamStateless"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "text/event-stream"); + builder.query("version", String.valueOf(this.version)); + final JsonObject contentJson = new JsonObject(); + if (messageStreamStatelessOptions.input() != null) { + contentJson.add( + "input", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(messageStreamStatelessOptions.input())); + } + if (messageStreamStatelessOptions.context() != null) { + contentJson.add( + "context", + com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() + .toJsonTree(messageStreamStatelessOptions.context())); + } + if (messageStreamStatelessOptions.userId() != null) { + contentJson.addProperty("user_id", messageStreamStatelessOptions.userId()); + } + builder.bodyJson(contentJson); + ResponseConverter responseConverter = ResponseConverterUtils.getInputStream(); + return createServiceCall(builder.build(), responseConverter); + } + /** * Identify intents and entities in multiple user utterances. * @@ -937,6 +1187,242 @@ public ServiceCall deployRelease(DeployReleaseOptions deployRelease return createServiceCall(builder.build(), responseConverter); } + /** + * Create release export. + * + *

Initiate an asynchronous process which will create a downloadable Zip file artifact + * (/package) for an assistant release. This artifact will contain Action and/or Dialog skills + * that are part of the release. The Dialog skill will only be included in the event that + * coexistence is enabled on the assistant. The expected workflow with the use of Release Export + * endpoint is to first initiate the creation of the artifact with the POST endpoint and then poll + * the GET endpoint to retrieve the artifact. Once the artifact has been created, it will last for + * the duration (/scope) of the release. + * + * @param createReleaseExportOptions the {@link CreateReleaseExportOptions} containing the options + * for the call + * @return a {@link ServiceCall} with a result of type {@link CreateReleaseExportWithStatusErrors} + */ + public ServiceCall createReleaseExport( + CreateReleaseExportOptions createReleaseExportOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + createReleaseExportOptions, "createReleaseExportOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", createReleaseExportOptions.assistantId()); + pathParamsMap.put("release", createReleaseExportOptions.release()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/releases/{release}/export", + pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "createReleaseExport"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (createReleaseExportOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(createReleaseExportOptions.includeAudit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken< + CreateReleaseExportWithStatusErrors>() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get release export. + * + *

A dual function endpoint to either retrieve the Zip file artifact that is associated with an + * assistant release or, retrieve the status of the artifact's creation. It is assumed that the + * artifact creation was already initiated prior to calling this endpoint. In the event that the + * artifact is not yet created and ready for download, this endpoint can be used to poll the + * system until the creation is completed or has failed. On the other hand, if the artifact is + * created, this endpoint will return the Zip file artifact as an octet stream. Once the artifact + * has been created, it will last for the duration (/scope) of the release. <br /><br + * /> When you will have downloaded the Zip file artifact, you have one of three ways to import + * it into an assistant's draft environment. These are as follows. <br + * /><ol><li>Import the zip package in Tooling via <var>"Assistant Settings" + * -> "Download/Upload files" -> "Upload" -> "Assistant + * only"</var>.</li><li>Import the zip package via "Create release import" + * endpoint using the APIs.</li><li>Extract the contents of the Zip file artifact and + * individually import the skill JSONs via skill update endpoints.</li></ol>. + * + * @param downloadReleaseExportOptions the {@link DownloadReleaseExportOptions} containing the + * options for the call + * @return a {@link ServiceCall} with a result of type {@link CreateReleaseExportWithStatusErrors} + */ + public ServiceCall downloadReleaseExport( + DownloadReleaseExportOptions downloadReleaseExportOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + downloadReleaseExportOptions, "downloadReleaseExportOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", downloadReleaseExportOptions.assistantId()); + pathParamsMap.put("release", downloadReleaseExportOptions.release()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/releases/{release}/export", + pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "downloadReleaseExport"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (downloadReleaseExportOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(downloadReleaseExportOptions.includeAudit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken< + CreateReleaseExportWithStatusErrors>() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get release export as stream. + * + *

A dual function endpoint to either retrieve the Zip file artifact that is associated with an + * assistant release or, retrieve the status of the artifact's creation. It is assumed that the + * artifact creation was already initiated prior to calling this endpoint. In the event that the + * artifact is not yet created and ready for download, this endpoint can be used to poll the + * system until the creation is completed or has failed. On the other hand, if the artifact is + * created, this endpoint will return the Zip file artifact as an octet stream. Once the artifact + * has been created, it will last for the duration (/scope) of the release. <br /><br + * /> When you will have downloaded the Zip file artifact, you have one of three ways to import + * it into an assistant's draft environment. These are as follows. <br + * /><ol><li>Import the zip package in Tooling via <var>"Assistant Settings" + * -> "Download/Upload files" -> "Upload" -> "Assistant + * only"</var>.</li><li>Import the zip package via "Create release import" + * endpoint using the APIs.</li><li>Extract the contents of the Zip file artifact and + * individually import the skill JSONs via skill update endpoints.</li></ol>. + * + * @param downloadReleaseExportOptions the {@link DownloadReleaseExportOptions} containing the + * options for the call + * @return a {@link ServiceCall} with a result of type {@link InputStream} + */ + public ServiceCall downloadReleaseExportAsStream( + DownloadReleaseExportOptions downloadReleaseExportOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + downloadReleaseExportOptions, "downloadReleaseExportOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", downloadReleaseExportOptions.assistantId()); + pathParamsMap.put("release", downloadReleaseExportOptions.release()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/assistants/{assistant_id}/releases/{release}/export", + pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "downloadReleaseExportAsStream"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/octet-stream"); + builder.query("version", String.valueOf(this.version)); + if (downloadReleaseExportOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(downloadReleaseExportOptions.includeAudit())); + } + ResponseConverter responseConverter = ResponseConverterUtils.getInputStream(); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Create release import. + * + *

Import a previously exported assistant release Zip file artifact (/package) into an + * assistant. This endpoint creates (/initiates) an asynchronous task (/job) in the background + * which will import the artifact contents into the draft environment of the assistant on which + * this endpoint is called. Specifically, the asynchronous operation will override the action + * and/or dialog skills in the assistant. It will be worth noting that when the artifact that is + * provided to this endpoint is from an assistant release which has coexistence enabled (i.e., it + * has both action and dialog skills), the import process will automatically enable coexistence, + * if not already enabled, on the assistant into which said artifact is being uploaded to. On the + * other hand, if the artifact package being imported only has action skill in it, the import + * asynchronous process will only override the draft environment's action skill, regardless of + * whether coexistence is enabled on the assistant into which the package is being imported. + * Lastly, the system will only run one asynchronous import at a time on an assistant. As such, + * consecutive imports will override previous import's updates to the skills in the draft + * environment. Once created, you may poll the completion of the import via the "Get release + * import Status" endpoint. + * + * @param createReleaseImportOptions the {@link CreateReleaseImportOptions} containing the options + * for the call + * @return a {@link ServiceCall} with a result of type {@link + * CreateAssistantReleaseImportResponse} + */ + public ServiceCall createReleaseImport( + CreateReleaseImportOptions createReleaseImportOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + createReleaseImportOptions, "createReleaseImportOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", createReleaseImportOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/import", pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "createReleaseImport"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (createReleaseImportOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(createReleaseImportOptions.includeAudit())); + } + builder.bodyContent(createReleaseImportOptions.body(), "application/octet-stream"); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken< + CreateAssistantReleaseImportResponse>() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Get release import Status. + * + *

Monitor the status of an assistant release import. You may poll this endpoint until the + * status of the import has either succeeded or failed. + * + * @param getReleaseImportStatusOptions the {@link GetReleaseImportStatusOptions} containing the + * options for the call + * @return a {@link ServiceCall} with a result of type {@link + * MonitorAssistantReleaseImportArtifactResponse} + */ + public ServiceCall getReleaseImportStatus( + GetReleaseImportStatusOptions getReleaseImportStatusOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + getReleaseImportStatusOptions, "getReleaseImportStatusOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("assistant_id", getReleaseImportStatusOptions.assistantId()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), "/v2/assistants/{assistant_id}/import", pathParamsMap)); + Map sdkHeaders = + SdkCommon.getSdkHeaders("conversation", "v2", "getReleaseImportStatus"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + if (getReleaseImportStatusOptions.includeAudit() != null) { + builder.query("include_audit", String.valueOf(getReleaseImportStatusOptions.includeAudit())); + } + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken< + MonitorAssistantReleaseImportArtifactResponse>() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + /** * Get skill. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java index 9c4866d5409..a5ad57a6d03 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AgentAvailabilityMessage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java index fd5a139ce80..a58601d0c33 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java index 9ecad740d0f..c8c471f9ab3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantData.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java index f44bf9a1f11..ed7e27d76d7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantSkill.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java index 5f5b8e07924..ec42a9ab0b7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/AssistantState.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java index 076295420de..99c91f1939b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestration.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -21,58 +22,8 @@ public class BaseEnvironmentOrchestration extends GenericModel { @SerializedName("search_skill_fallback") protected Boolean searchSkillFallback; - /** Builder. */ - public static class Builder { - private Boolean searchSkillFallback; - - /** - * Instantiates a new Builder from an existing BaseEnvironmentOrchestration instance. - * - * @param baseEnvironmentOrchestration the instance to initialize the Builder with - */ - private Builder(BaseEnvironmentOrchestration baseEnvironmentOrchestration) { - this.searchSkillFallback = baseEnvironmentOrchestration.searchSkillFallback; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a BaseEnvironmentOrchestration. - * - * @return the new BaseEnvironmentOrchestration instance - */ - public BaseEnvironmentOrchestration build() { - return new BaseEnvironmentOrchestration(this); - } - - /** - * Set the searchSkillFallback. - * - * @param searchSkillFallback the searchSkillFallback - * @return the BaseEnvironmentOrchestration builder - */ - public Builder searchSkillFallback(Boolean searchSkillFallback) { - this.searchSkillFallback = searchSkillFallback; - return this; - } - } - protected BaseEnvironmentOrchestration() {} - protected BaseEnvironmentOrchestration(Builder builder) { - searchSkillFallback = builder.searchSkillFallback; - } - - /** - * New builder. - * - * @return a BaseEnvironmentOrchestration builder - */ - public Builder newBuilder() { - return new Builder(this); - } - /** * Gets the searchSkillFallback. * @@ -82,7 +33,7 @@ public Builder newBuilder() { * * @return the searchSkillFallback */ - public Boolean searchSkillFallback() { + public Boolean isSearchSkillFallback() { return searchSkillFallback; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java index 275437d5770..83988680d4a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReference.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -19,58 +20,8 @@ public class BaseEnvironmentReleaseReference extends GenericModel { protected String release; - /** Builder. */ - public static class Builder { - private String release; - - /** - * Instantiates a new Builder from an existing BaseEnvironmentReleaseReference instance. - * - * @param baseEnvironmentReleaseReference the instance to initialize the Builder with - */ - private Builder(BaseEnvironmentReleaseReference baseEnvironmentReleaseReference) { - this.release = baseEnvironmentReleaseReference.release; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a BaseEnvironmentReleaseReference. - * - * @return the new BaseEnvironmentReleaseReference instance - */ - public BaseEnvironmentReleaseReference build() { - return new BaseEnvironmentReleaseReference(this); - } - - /** - * Set the release. - * - * @param release the release - * @return the BaseEnvironmentReleaseReference builder - */ - public Builder release(String release) { - this.release = release; - return this; - } - } - protected BaseEnvironmentReleaseReference() {} - protected BaseEnvironmentReleaseReference(Builder builder) { - release = builder.release; - } - - /** - * New builder. - * - * @return a BaseEnvironmentReleaseReference builder - */ - public Builder newBuilder() { - return new Builder(this); - } - /** * Gets the release. * @@ -78,7 +29,7 @@ public Builder newBuilder() { * * @return the release */ - public String release() { + public String getRelease() { return release; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java index edf33d9ab81..926510629f0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java index af7f8c35747..e40425a7c58 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyOutput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java index dcd341597eb..f9b8bf8734c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java index 435af700aaa..7c18e41109b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/BulkClassifyUtterance.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java index 2a3acaeab9f..4b040d9d8ff 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CaptureGroup.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java index e6a5741c807..64b78d77730 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferInfo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java index c4e396b6b0e..21b3b7ff1c1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTarget.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java index 6e4ef47dcb5..ff4ebb0f5a8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ChannelTransferTargetChat.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionCrawlStatus.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CompleteItem.java similarity index 51% rename from discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionCrawlStatus.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/CompleteItem.java index 615e34021aa..ecb728734cb 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionCrawlStatus.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CompleteItem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,27 +10,33 @@ * 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.ibm.watson.discovery.v1.model; + +package com.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** Object containing information about the crawl status of this collection. */ -public class CollectionCrawlStatus extends GenericModel { +/** CompleteItem. */ +public class CompleteItem extends RuntimeResponseGeneric { + + /** The preferred type of control to display. */ + public interface Preference { + /** dropdown. */ + String DROPDOWN = "dropdown"; + /** button. */ + String BUTTON = "button"; + } - @SerializedName("source_crawl") - protected SourceStatus sourceCrawl; + @SerializedName("streaming_metadata") + protected Metadata streamingMetadata; - protected CollectionCrawlStatus() {} + protected CompleteItem() {} /** - * Gets the sourceCrawl. - * - *

Object containing source crawl status information. + * Gets the streamingMetadata. * - * @return the sourceCrawl + * @return the streamingMetadata */ - public SourceStatus getSourceCrawl() { - return sourceCrawl; + public Metadata getStreamingMetadata() { + return streamingMetadata; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java index e3858f4eb9f..be3c309ab64 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantReleaseImportResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantReleaseImportResponse.java new file mode 100644 index 00000000000..64909e1bca8 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateAssistantReleaseImportResponse.java @@ -0,0 +1,129 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Date; +import java.util.List; + +/** CreateAssistantReleaseImportResponse. */ +public class CreateAssistantReleaseImportResponse extends GenericModel { + + /** + * The current status of the artifact import process: - **Failed**: The asynchronous artifact + * import process has failed. - **Processing**: An asynchronous operation to import artifact is + * underway and not yet completed. + */ + public interface Status { + /** Failed. */ + String FAILED = "Failed"; + /** Processing. */ + String PROCESSING = "Processing"; + } + + /** The type of the skill in the draft environment. */ + public interface SkillImpactInDraft { + /** action. */ + String ACTION = "action"; + /** dialog. */ + String DIALOG = "dialog"; + } + + protected String status; + + @SerializedName("task_id") + protected String taskId; + + @SerializedName("assistant_id") + protected String assistantId; + + @SerializedName("skill_impact_in_draft") + protected List skillImpactInDraft; + + protected Date created; + protected Date updated; + + protected CreateAssistantReleaseImportResponse() {} + + /** + * Gets the status. + * + *

The current status of the artifact import process: - **Failed**: The asynchronous artifact + * import process has failed. - **Processing**: An asynchronous operation to import artifact is + * underway and not yet completed. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the taskId. + * + *

A unique identifier for a background asynchronous task that is executing or has executed the + * operation. + * + * @return the taskId + */ + public String getTaskId() { + return taskId; + } + + /** + * Gets the assistantId. + * + *

The ID of the assistant to which the release belongs. + * + * @return the assistantId + */ + public String getAssistantId() { + return assistantId; + } + + /** + * Gets the skillImpactInDraft. + * + *

An array of skill types in the draft environment which will be overridden with skills from + * the artifact being imported. + * + * @return the skillImpactInDraft + */ + public List getSkillImpactInDraft() { + return skillImpactInDraft; + } + + /** + * Gets the created. + * + *

The timestamp for creation of the object. + * + * @return the created + */ + public Date getCreated() { + return created; + } + + /** + * Gets the updated. + * + *

The timestamp for the most recent update to the object. + * + * @return the updated + */ + public Date getUpdated() { + return updated; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateProviderOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateProviderOptions.java new file mode 100644 index 00000000000..70a3b6527f6 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateProviderOptions.java @@ -0,0 +1,155 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The createProvider options. */ +public class CreateProviderOptions extends GenericModel { + + protected String providerId; + protected ProviderSpecification specification; + protected ProviderPrivate xPrivate; + + /** Builder. */ + public static class Builder { + private String providerId; + private ProviderSpecification specification; + private ProviderPrivate xPrivate; + + /** + * Instantiates a new Builder from an existing CreateProviderOptions instance. + * + * @param createProviderOptions the instance to initialize the Builder with + */ + private Builder(CreateProviderOptions createProviderOptions) { + this.providerId = createProviderOptions.providerId; + this.specification = createProviderOptions.specification; + this.xPrivate = createProviderOptions.xPrivate; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param providerId the providerId + * @param specification the specification + * @param xPrivate the xPrivate + */ + public Builder( + String providerId, ProviderSpecification specification, ProviderPrivate xPrivate) { + this.providerId = providerId; + this.specification = specification; + this.xPrivate = xPrivate; + } + + /** + * Builds a CreateProviderOptions. + * + * @return the new CreateProviderOptions instance + */ + public CreateProviderOptions build() { + return new CreateProviderOptions(this); + } + + /** + * Set the providerId. + * + * @param providerId the providerId + * @return the CreateProviderOptions builder + */ + public Builder providerId(String providerId) { + this.providerId = providerId; + return this; + } + + /** + * Set the specification. + * + * @param specification the specification + * @return the CreateProviderOptions builder + */ + public Builder specification(ProviderSpecification specification) { + this.specification = specification; + return this; + } + + /** + * Set the xPrivate. + * + * @param xPrivate the xPrivate + * @return the CreateProviderOptions builder + */ + public Builder xPrivate(ProviderPrivate xPrivate) { + this.xPrivate = xPrivate; + return this; + } + } + + protected CreateProviderOptions() {} + + protected CreateProviderOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.providerId, "providerId cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.specification, "specification cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.xPrivate, "xPrivate cannot be null"); + providerId = builder.providerId; + specification = builder.specification; + xPrivate = builder.xPrivate; + } + + /** + * New builder. + * + * @return a CreateProviderOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerId. + * + *

The unique identifier of the provider. + * + * @return the providerId + */ + public String providerId() { + return providerId; + } + + /** + * Gets the specification. + * + *

The specification of the provider. + * + * @return the specification + */ + public ProviderSpecification specification() { + return specification; + } + + /** + * Gets the xPrivate. + * + *

Private information of the provider. + * + * @return the xPrivate + */ + public ProviderPrivate xPrivate() { + return xPrivate; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java new file mode 100644 index 00000000000..5aa750c4a4b --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptions.java @@ -0,0 +1,162 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The createReleaseExport options. */ +public class CreateReleaseExportOptions extends GenericModel { + + protected String assistantId; + protected String release; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String release; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing CreateReleaseExportOptions instance. + * + * @param createReleaseExportOptions the instance to initialize the Builder with + */ + private Builder(CreateReleaseExportOptions createReleaseExportOptions) { + this.assistantId = createReleaseExportOptions.assistantId; + this.release = createReleaseExportOptions.release; + this.includeAudit = createReleaseExportOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param release the release + */ + public Builder(String assistantId, String release) { + this.assistantId = assistantId; + this.release = release; + } + + /** + * Builds a CreateReleaseExportOptions. + * + * @return the new CreateReleaseExportOptions instance + */ + public CreateReleaseExportOptions build() { + return new CreateReleaseExportOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the CreateReleaseExportOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the release. + * + * @param release the release + * @return the CreateReleaseExportOptions builder + */ + public Builder release(String release) { + this.release = release; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the CreateReleaseExportOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected CreateReleaseExportOptions() {} + + protected CreateReleaseExportOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.release, "release cannot be empty"); + assistantId = builder.assistantId; + release = builder.release; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a CreateReleaseExportOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * environment ID of the environment where the assistant is deployed. - For all other requests, + * specify the assistant ID of the assistant. + * + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the release. + * + *

Unique identifier of the release. + * + * @return the release + */ + public String release() { + return release; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportWithStatusErrors.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportWithStatusErrors.java new file mode 100644 index 00000000000..7e7353f9790 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportWithStatusErrors.java @@ -0,0 +1,151 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Date; +import java.util.List; + +/** CreateReleaseExportWithStatusErrors. */ +public class CreateReleaseExportWithStatusErrors extends GenericModel { + + /** + * The current status of the release export creation process: - **Available**: The release export + * package is available for download. - **Failed**: The asynchronous release export package + * creation process has failed. - **Processing**: An asynchronous operation to create the release + * export package is underway and not yet completed. + */ + public interface Status { + /** Available. */ + String AVAILABLE = "Available"; + /** Failed. */ + String FAILED = "Failed"; + /** Processing. */ + String PROCESSING = "Processing"; + } + + protected String status; + + @SerializedName("task_id") + protected String taskId; + + @SerializedName("assistant_id") + protected String assistantId; + + protected String release; + protected Date created; + protected Date updated; + + @SerializedName("status_errors") + protected List statusErrors; + + @SerializedName("status_description") + protected String statusDescription; + + protected CreateReleaseExportWithStatusErrors() {} + + /** + * Gets the status. + * + *

The current status of the release export creation process: - **Available**: The release + * export package is available for download. - **Failed**: The asynchronous release export package + * creation process has failed. - **Processing**: An asynchronous operation to create the release + * export package is underway and not yet completed. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the taskId. + * + *

A unique identifier for a background asynchronous task that is executing or has executed the + * operation. + * + * @return the taskId + */ + public String getTaskId() { + return taskId; + } + + /** + * Gets the assistantId. + * + *

The ID of the assistant to which the release belongs. + * + * @return the assistantId + */ + public String getAssistantId() { + return assistantId; + } + + /** + * Gets the release. + * + *

The name of the release. The name is the version number (an integer), returned as a string. + * + * @return the release + */ + public String getRelease() { + return release; + } + + /** + * Gets the created. + * + *

The timestamp for creation of the object. + * + * @return the created + */ + public Date getCreated() { + return created; + } + + /** + * Gets the updated. + * + *

The timestamp for the most recent update to the object. + * + * @return the updated + */ + public Date getUpdated() { + return updated; + } + + /** + * Gets the statusErrors. + * + *

An array of messages about errors that caused an asynchronous operation to fail. Included + * only if **status**=`Failed`. + * + * @return the statusErrors + */ + public List getStatusErrors() { + return statusErrors; + } + + /** + * Gets the statusDescription. + * + *

The description of the failed asynchronous operation. Included only if **status**=`Failed`. + * + * @return the statusDescription + */ + public String getStatusDescription() { + return statusDescription; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java new file mode 100644 index 00000000000..5c25837a1fe --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptions.java @@ -0,0 +1,178 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; + +/** The createReleaseImport options. */ +public class CreateReleaseImportOptions extends GenericModel { + + protected String assistantId; + protected InputStream body; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private String assistantId; + private InputStream body; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing CreateReleaseImportOptions instance. + * + * @param createReleaseImportOptions the instance to initialize the Builder with + */ + private Builder(CreateReleaseImportOptions createReleaseImportOptions) { + this.assistantId = createReleaseImportOptions.assistantId; + this.body = createReleaseImportOptions.body; + this.includeAudit = createReleaseImportOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param body the body + */ + public Builder(String assistantId, InputStream body) { + this.assistantId = assistantId; + this.body = body; + } + + /** + * Builds a CreateReleaseImportOptions. + * + * @return the new CreateReleaseImportOptions instance + */ + public CreateReleaseImportOptions build() { + return new CreateReleaseImportOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the CreateReleaseImportOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the body. + * + * @param body the body + * @return the CreateReleaseImportOptions builder + */ + public Builder body(InputStream body) { + this.body = body; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the CreateReleaseImportOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + + /** + * Set the body. + * + * @param body the body + * @return the CreateReleaseImportOptions builder + * @throws FileNotFoundException if the file could not be found + */ + public Builder body(File body) throws FileNotFoundException { + this.body = new FileInputStream(body); + return this; + } + } + + protected CreateReleaseImportOptions() {} + + protected CreateReleaseImportOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.body, "body cannot be null"); + assistantId = builder.assistantId; + body = builder.body; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a CreateReleaseImportOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * environment ID of the environment where the assistant is deployed. - For all other requests, + * specify the assistant ID of the assistant. + * + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the body. + * + *

Request body is an Octet-stream of the artifact Zip file that is being imported. + * + * @return the body + */ + public InputStream body() { + return body; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java index 67096e9ddf1..e77ee9b4c48 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateReleaseOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java index 07c065d4818..c9731f2334c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/CreateSessionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java index 40b27e6bdc8..5b6a60c879e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteAssistantOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java index 230c9d4b70a..a800d9be563 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteReleaseOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java index bab9f8e0a40..c7e3ac2e8cf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteSessionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java index d413deeaab4..ab31e077f93 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeleteUserDataOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java index 4ec983e483d..9fd1b9afda7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DeployReleaseOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java index 51788a2e003..b8233f14bc7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogLogMessage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java index 231d8a601b8..2a9ef0237d4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeAction.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java index b18ff5f0dca..d2d9ac173a0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputConnectToAgentTransferInfo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java index 976eb37ea80..812e7fe1451 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElement.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java index c8af9f2f7e1..46c1e983f75 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeOutputOptionsElementValue.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java index 0c574579a08..081831d5904 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogNodeVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java index d711ee0e9cf..eb1c29b233f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestion.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java index 035714b4a54..fb3208180fb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DialogSuggestionValue.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java new file mode 100644 index 00000000000..e902819c84c --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptions.java @@ -0,0 +1,162 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The downloadReleaseExport options. */ +public class DownloadReleaseExportOptions extends GenericModel { + + protected String assistantId; + protected String release; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String release; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing DownloadReleaseExportOptions instance. + * + * @param downloadReleaseExportOptions the instance to initialize the Builder with + */ + private Builder(DownloadReleaseExportOptions downloadReleaseExportOptions) { + this.assistantId = downloadReleaseExportOptions.assistantId; + this.release = downloadReleaseExportOptions.release; + this.includeAudit = downloadReleaseExportOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param release the release + */ + public Builder(String assistantId, String release) { + this.assistantId = assistantId; + this.release = release; + } + + /** + * Builds a DownloadReleaseExportOptions. + * + * @return the new DownloadReleaseExportOptions instance + */ + public DownloadReleaseExportOptions build() { + return new DownloadReleaseExportOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the DownloadReleaseExportOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the release. + * + * @param release the release + * @return the DownloadReleaseExportOptions builder + */ + public Builder release(String release) { + this.release = release; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the DownloadReleaseExportOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected DownloadReleaseExportOptions() {} + + protected DownloadReleaseExportOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.release, "release cannot be empty"); + assistantId = builder.assistantId; + release = builder.release; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a DownloadReleaseExportOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * environment ID of the environment where the assistant is deployed. - For all other requests, + * specify the assistant ID of the assistant. + * + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the release. + * + *

Unique identifier of the release. + * + * @return the release + */ + public String release() { + return release; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java index b4a0ad8a2ae..76f418cc8ec 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Environment.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java index 120e14458a0..e4b387f144c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java index d78b2c6a0b8..987a43cb75d 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentReference.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java index 5bb781a2e52..8514538fca3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/EnvironmentSkill.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java index 869f014832e..5cedb8d8b1e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ExportSkillsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/FinalResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/FinalResponse.java new file mode 100644 index 00000000000..b2e923a9e9a --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/FinalResponse.java @@ -0,0 +1,102 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Message final response content. */ +public class FinalResponse extends GenericModel { + + protected FinalResponseOutput output; + protected MessageContext context; + + @SerializedName("user_id") + protected String userId; + + @SerializedName("masked_output") + protected MessageOutput maskedOutput; + + @SerializedName("masked_input") + protected MessageInput maskedInput; + + protected FinalResponse() {} + + /** + * Gets the output. + * + *

Assistant output to be rendered or processed by the client. + * + * @return the output + */ + public FinalResponseOutput getOutput() { + return output; + } + + /** + * Gets the context. + * + *

Context data for the conversation. You can use this property to access context variables. + * The context is stored by the assistant on a per-session basis. + * + *

**Note:** The context is included in message responses only if **return_context**=`true` in + * the message request. Full context is always included in logs. + * + * @return the context + */ + public MessageContext getContext() { + return context; + } + + /** + * Gets the userId. + * + *

A string value that identifies the user who is interacting with the assistant. The client + * must provide a unique identifier for each individual end user who accesses the application. For + * user-based plans, this user ID is used to identify unique users for billing purposes. This + * string cannot contain carriage return, newline, or tab characters. If no value is specified in + * the input, **user_id** is automatically set to the value of **context.global.session_id**. + * + *

**Note:** This property is the same as the **user_id** property in the global system + * context. + * + * @return the userId + */ + public String getUserId() { + return userId; + } + + /** + * Gets the maskedOutput. + * + *

Assistant output to be rendered or processed by the client. All private data is masked or + * removed. + * + * @return the maskedOutput + */ + public MessageOutput getMaskedOutput() { + return maskedOutput; + } + + /** + * Gets the maskedInput. + * + *

An input object that includes the input text. All private data is masked or removed. + * + * @return the maskedInput + */ + public MessageInput getMaskedInput() { + return maskedInput; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/FinalResponseOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/FinalResponseOutput.java new file mode 100644 index 00000000000..c8c3161e7d7 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/FinalResponseOutput.java @@ -0,0 +1,129 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; +import java.util.Map; + +/** Assistant output to be rendered or processed by the client. */ +public class FinalResponseOutput extends GenericModel { + + protected List generic; + protected List intents; + protected List entities; + protected List actions; + protected MessageOutputDebug debug; + + @SerializedName("user_defined") + protected Map userDefined; + + protected MessageOutputSpelling spelling; + + @SerializedName("streaming_metadata") + protected MessageStreamMetadata streamingMetadata; + + protected FinalResponseOutput() {} + + /** + * Gets the generic. + * + *

Output intended for any channel. It is the responsibility of the client application to + * implement the supported response types. + * + * @return the generic + */ + public List getGeneric() { + return generic; + } + + /** + * Gets the intents. + * + *

An array of intents recognized in the user input, sorted in descending order of confidence. + * + * @return the intents + */ + public List getIntents() { + return intents; + } + + /** + * Gets the entities. + * + *

An array of entities identified in the user input. + * + * @return the entities + */ + public List getEntities() { + return entities; + } + + /** + * Gets the actions. + * + *

An array of objects describing any actions requested by the dialog node. + * + * @return the actions + */ + public List getActions() { + return actions; + } + + /** + * Gets the debug. + * + *

Additional detailed information about a message response and how it was generated. + * + * @return the debug + */ + public MessageOutputDebug getDebug() { + return debug; + } + + /** + * Gets the userDefined. + * + *

An object containing any custom properties included in the response. This object includes + * any arbitrary properties defined in the dialog JSON editor as part of the dialog node output. + * + * @return the userDefined + */ + public Map getUserDefined() { + return userDefined; + } + + /** + * Gets the spelling. + * + *

Properties describing any spelling corrections in the user input that was received. + * + * @return the spelling + */ + public MessageOutputSpelling getSpelling() { + return spelling; + } + + /** + * Gets the streamingMetadata. + * + *

Contains meta-information about the item(s) being streamed. + * + * @return the streamingMetadata + */ + public MessageStreamMetadata getStreamingMetadata() { + return streamingMetadata; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java index e2c5667b677..d2a3885e1cf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetEnvironmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java new file mode 100644 index 00000000000..de8feba7f8f --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptions.java @@ -0,0 +1,133 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The getReleaseImportStatus options. */ +public class GetReleaseImportStatusOptions extends GenericModel { + + protected String assistantId; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private String assistantId; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing GetReleaseImportStatusOptions instance. + * + * @param getReleaseImportStatusOptions the instance to initialize the Builder with + */ + private Builder(GetReleaseImportStatusOptions getReleaseImportStatusOptions) { + this.assistantId = getReleaseImportStatusOptions.assistantId; + this.includeAudit = getReleaseImportStatusOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + */ + public Builder(String assistantId) { + this.assistantId = assistantId; + } + + /** + * Builds a GetReleaseImportStatusOptions. + * + * @return the new GetReleaseImportStatusOptions instance + */ + public GetReleaseImportStatusOptions build() { + return new GetReleaseImportStatusOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the GetReleaseImportStatusOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the GetReleaseImportStatusOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected GetReleaseImportStatusOptions() {} + + protected GetReleaseImportStatusOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + assistantId = builder.assistantId; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a GetReleaseImportStatusOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * environment ID of the environment where the assistant is deployed. - For all other requests, + * specify the assistant ID of the assistant. + * + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java index e21331f728e..929f5d9d8a8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetReleaseOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java index c0e5dd256d3..8c8db0ec27f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/GetSkillOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java index 76fa94a63a1..1247413eb2c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java index 4227b1ae985..1622185d1bf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ImportSkillsStatusOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/InputStreamConnectStrategy.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/InputStreamConnectStrategy.java new file mode 100644 index 00000000000..17c5b2ec93e --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/InputStreamConnectStrategy.java @@ -0,0 +1,123 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.launchdarkly.eventsource.ConnectStrategy; +import com.launchdarkly.eventsource.StreamException; +import com.launchdarkly.logging.LDLogger; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; + +public class InputStreamConnectStrategy extends ConnectStrategy { + + protected InputStream inputStream; + + /** Builder. */ + public static class Builder { + private InputStream inputStream; + + /** + * Instantiates a new Builder from an existing InputStreamConnectStrategy instance. + * + * @param inputStreamConnectStrategy the instance to initialize the Builder with + */ + private Builder(InputStreamConnectStrategy inputStreamConnectStrategy) { + this.inputStream = inputStreamConnectStrategy.inputStream; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param inputStream the inputStream + */ + public Builder(InputStream inputStream) { + this.inputStream = inputStream; + } + + /** + * Builds a InputStreamConnectStrategy. + * + * @return the new InputStreamConnectStrategy instance + */ + public InputStreamConnectStrategy build() { + return new InputStreamConnectStrategy(this); + } + + /** + * Set the inputStream. + * + * @param inputStream the inputStream + * @return the InputStreamConnectStrategy builder + */ + public Builder inputStream(InputStream inputStream) { + this.inputStream = inputStream; + return this; + } + } + + protected InputStreamConnectStrategy() {} + + protected InputStreamConnectStrategy(Builder builder) { + inputStream = builder.inputStream; + } + + /** + * New builder. + * + * @return a InputStreamConnectStrategy builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the inputStream. + * + * @return the inputStream + */ + public InputStream inputStream() { + return inputStream; + } + + @Override + public Client createClient(LDLogger ldLogger) { + Client client = new Client() { + @Override + public Result connect(String s) throws StreamException { + Result result = new Result(inputStream, null, inputStream); + return result; + } + + @Override + public boolean awaitClosed(long l) throws InterruptedException { + return false; + } + + @Override + public URI getOrigin() { + return null; + } + + @Override + public void close() throws IOException { + inputStream.close(); + } + }; + return client; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java index 6f455b7cbcb..d2fa6f8874a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/IntegrationReference.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java index 7afdf0280a0..5eabe3c0a62 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListAssistantsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java index b3a1ff10461..1037229a838 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListEnvironmentsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java index e2cd21e79a7..ef7a3514dd7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListLogsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListProvidersOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListProvidersOptions.java new file mode 100644 index 00000000000..56f04a797bb --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListProvidersOptions.java @@ -0,0 +1,204 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The listProviders options. */ +public class ListProvidersOptions extends GenericModel { + + /** + * The attribute by which returned conversational skill providers will be sorted. To reverse the + * sort order, prefix the value with a minus sign (`-`). + */ + public interface Sort { + /** name. */ + String NAME = "name"; + /** updated. */ + String UPDATED = "updated"; + } + + protected Long pageLimit; + protected Boolean includeCount; + protected String sort; + protected String cursor; + protected Boolean includeAudit; + + /** Builder. */ + public static class Builder { + private Long pageLimit; + private Boolean includeCount; + private String sort; + private String cursor; + private Boolean includeAudit; + + /** + * Instantiates a new Builder from an existing ListProvidersOptions instance. + * + * @param listProvidersOptions the instance to initialize the Builder with + */ + private Builder(ListProvidersOptions listProvidersOptions) { + this.pageLimit = listProvidersOptions.pageLimit; + this.includeCount = listProvidersOptions.includeCount; + this.sort = listProvidersOptions.sort; + this.cursor = listProvidersOptions.cursor; + this.includeAudit = listProvidersOptions.includeAudit; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ListProvidersOptions. + * + * @return the new ListProvidersOptions instance + */ + public ListProvidersOptions build() { + return new ListProvidersOptions(this); + } + + /** + * Set the pageLimit. + * + * @param pageLimit the pageLimit + * @return the ListProvidersOptions builder + */ + public Builder pageLimit(long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set the includeCount. + * + * @param includeCount the includeCount + * @return the ListProvidersOptions builder + */ + public Builder includeCount(Boolean includeCount) { + this.includeCount = includeCount; + return this; + } + + /** + * Set the sort. + * + * @param sort the sort + * @return the ListProvidersOptions builder + */ + public Builder sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set the cursor. + * + * @param cursor the cursor + * @return the ListProvidersOptions builder + */ + public Builder cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * Set the includeAudit. + * + * @param includeAudit the includeAudit + * @return the ListProvidersOptions builder + */ + public Builder includeAudit(Boolean includeAudit) { + this.includeAudit = includeAudit; + return this; + } + } + + protected ListProvidersOptions() {} + + protected ListProvidersOptions(Builder builder) { + pageLimit = builder.pageLimit; + includeCount = builder.includeCount; + sort = builder.sort; + cursor = builder.cursor; + includeAudit = builder.includeAudit; + } + + /** + * New builder. + * + * @return a ListProvidersOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the pageLimit. + * + *

The number of records to return in each page of results. + * + * @return the pageLimit + */ + public Long pageLimit() { + return pageLimit; + } + + /** + * Gets the includeCount. + * + *

Whether to include information about the number of records that satisfy the request, + * regardless of the page limit. If this parameter is `true`, the `pagination` object in the + * response includes the `total` property. + * + * @return the includeCount + */ + public Boolean includeCount() { + return includeCount; + } + + /** + * Gets the sort. + * + *

The attribute by which returned conversational skill providers will be sorted. To reverse + * the sort order, prefix the value with a minus sign (`-`). + * + * @return the sort + */ + public String sort() { + return sort; + } + + /** + * Gets the cursor. + * + *

A token identifying the page of results to retrieve. + * + * @return the cursor + */ + public String cursor() { + return cursor; + } + + /** + * Gets the includeAudit. + * + *

Whether to include the audit properties (`created` and `updated` timestamps) in the + * response. + * + * @return the includeAudit + */ + public Boolean includeAudit() { + return includeAudit; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java index f298b2e3016..09a334cc414 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ListReleasesOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java index 6c991752888..167d3c57992 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Log.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java index 841bd5331d9..ff6347d16d4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSource.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSource.java index 8705e0a6acc..94fdb6326dc 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSource.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java index 457b07b25d5..48abb2199d5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceAction.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java index b722b5080b1..b9d86634e19 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceDialogNode.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java index d87ab86fce3..ee561518196 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceHandler.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java index 92c6c1ae1fe..0d9f650e2d9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogMessageSourceStep.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** An object that identifies the dialog element that generated the error message. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java index 8f1f54a489f..139dfe1a7ff 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogPagination.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequest.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequest.java index a76b154364d..57212bb192f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequest.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequestInput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequestInput.java index 9cd634b3e39..ec17a513f17 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequestInput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogRequestInput.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponse.java index 4addd4267f8..9ee1ca07382 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponse.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponseOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponseOutput.java index 1229aa9158c..7e89e07c93a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponseOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/LogResponseOutput.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java index 0134c13f79f..9554af80fae 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContext.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextActionSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextActionSkill.java index f172a5ccde4..1075b69a5c2 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextActionSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextActionSkill.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextDialogSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextDialogSkill.java index b53c7112355..1f414becb16 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextDialogSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextDialogSkill.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java index f87e3069d98..66d65e00a15 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobal.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java index e7cf359875f..97b18271d41 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextGlobalSystem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java index 00cdc10a07d..8c9d6d467ec 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkillSystem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -18,7 +19,11 @@ import java.util.HashMap; import java.util.Map; -/** System context data used by the skill. */ +/** + * System context data used by the skill. + * + *

This type supports additional properties of type Object. For internal use only. + */ public class MessageContextSkillSystem extends DynamicModel { @SerializedName("state") @@ -67,7 +72,7 @@ public Builder state(String state) { } /** - * Add an arbitrary property. + * Add an arbitrary property. For internal use only. * * @param name the name of the property to add * @param value the value of the property to add diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java index a7c0e57d409..659eaba8ab7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageContextSkills.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageEventDeserializer.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageEventDeserializer.java new file mode 100644 index 00000000000..48c0fd77778 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageEventDeserializer.java @@ -0,0 +1,137 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.Gson; +import com.launchdarkly.eventsource.EventSource; +import com.launchdarkly.eventsource.MessageEvent; +import java.io.InputStream; +import java.util.Iterator; + +public class MessageEventDeserializer extends MessageStreamResponse { + + protected EventSource eventSource; + + /** Builder. */ + public static class Builder { + private EventSource eventSource; + + /** + * Instantiates a new Builder from an existing MessageEventDeserializer instance. + * + * @param messageEventDeserializer the instance to initialize the Builder with + */ + private Builder(MessageEventDeserializer messageEventDeserializer) { + this.eventSource = messageEventDeserializer.eventSource; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param inputStream the inputStream + */ + public Builder(InputStream inputStream) { + InputStreamConnectStrategy inputStreamConnectStrategy = + new InputStreamConnectStrategy.Builder().inputStream(inputStream).build(); + this.eventSource = new EventSource.Builder(inputStreamConnectStrategy).build(); + } + + /** + * Builds a MessageEventDeserializer. + * + * @return the new MessageEventDeserializer instance + */ + public MessageEventDeserializer build() { + return new MessageEventDeserializer(this); + } + + /** + * Set the inputStream. + * + * @param inputStream the inputStream + * @return the MessageEventDeserializer builder + */ + public MessageEventDeserializer.Builder inputStream(InputStream inputStream) { + InputStreamConnectStrategy inputStreamConnectStrategy = + new InputStreamConnectStrategy.Builder().inputStream(inputStream).build(); + this.eventSource = new EventSource.Builder(inputStreamConnectStrategy).build(); + return this; + } + } + + protected MessageEventDeserializer() {} + + protected MessageEventDeserializer(MessageEventDeserializer.Builder builder) { + eventSource = builder.eventSource; + } + + /** + * New builder. + * + * @return a MessageEventDeserializer builder + */ + public MessageEventDeserializer.Builder newBuilder() { + return new MessageEventDeserializer.Builder(this); + } + + public Iterable messages() { + return () -> new IteratorImpl<>(eventSource.messages()); + } + + public Iterable statelessMessages() { + return () -> new StatelessIteratorImpl<>(eventSource.messages()); + } + + + private class IteratorImpl implements Iterator { + private final Iterable messageEvents; + + IteratorImpl(Iterable messageEvents) { + this.messageEvents = messageEvents; + } + + public boolean hasNext() { + return messageEvents.iterator().hasNext(); + } + + public T next() { + Gson gson = new Gson(); + MessageEvent messageEvent = messageEvents.iterator().next(); + T item = (T) gson.fromJson(messageEvent.getData(), MessageStreamResponse.class); + return item; + } + } + + private class StatelessIteratorImpl implements Iterator { + private final Iterable messageEvents; + + StatelessIteratorImpl(Iterable messageEvents) { + this.messageEvents = messageEvents; + } + + public boolean hasNext() { + return messageEvents.iterator().hasNext(); + } + + public T next() { + Gson gson = new Gson(); + MessageEvent messageEvent = messageEvents.iterator().next(); + T item = (T) gson.fromJson(messageEvent.getData(), StatelessMessageStreamResponse.class); + return item; + } + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java index 8b1301df360..eb816d5fb97 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInput.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java index 4becb71631d..6a3e4017b12 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputAttachment.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java index 6dbe7931895..99c897864e4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java index f9b528d92dc..a8c8206ed61 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageInputOptionsSpelling.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java index ee3d8840c3f..69c6ea59bca 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -18,6 +19,7 @@ public class MessageOptions extends GenericModel { protected String assistantId; + protected String environmentId; protected String sessionId; protected MessageInput input; protected MessageContext context; @@ -26,6 +28,7 @@ public class MessageOptions extends GenericModel { /** Builder. */ public static class Builder { private String assistantId; + private String environmentId; private String sessionId; private MessageInput input; private MessageContext context; @@ -38,6 +41,7 @@ public static class Builder { */ private Builder(MessageOptions messageOptions) { this.assistantId = messageOptions.assistantId; + this.environmentId = messageOptions.environmentId; this.sessionId = messageOptions.sessionId; this.input = messageOptions.input; this.context = messageOptions.context; @@ -51,10 +55,12 @@ public Builder() {} * Instantiates a new builder with required properties. * * @param assistantId the assistantId + * @param environmentId the environmentId * @param sessionId the sessionId */ - public Builder(String assistantId, String sessionId) { + public Builder(String assistantId, String environmentId, String sessionId) { this.assistantId = assistantId; + this.environmentId = environmentId; this.sessionId = sessionId; } @@ -78,6 +84,17 @@ public Builder assistantId(String assistantId) { return this; } + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the MessageOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + /** * Set the sessionId. * @@ -128,8 +145,11 @@ protected MessageOptions() {} protected MessageOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty( builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.sessionId, "sessionId cannot be empty"); assistantId = builder.assistantId; + environmentId = builder.environmentId; sessionId = builder.sessionId; input = builder.input; context = builder.context; @@ -166,6 +186,19 @@ public String assistantId() { return assistantId; } + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + /** * Gets the sessionId. * diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java index 4169f9cf117..a76c7ce378b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutput.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java index b857f6bc6da..b32857b7da6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebug.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java index 2cc111d8bec..97057b4dd96 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEvent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -47,7 +48,6 @@ public class MessageOutputDebugTurnEvent extends GenericModel { discriminatorMapping.put("search", MessageOutputDebugTurnEventTurnEventSearch.class); discriminatorMapping.put("node_visited", MessageOutputDebugTurnEventTurnEventNodeVisited.class); } - /** The type of condition (if any) that is defined for the action. */ public interface ConditionType { /** user_defined. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java index 90e69e62c8e..57efba8589e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionFinished.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventActionFinished. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java index 46e74444512..1ed5d4579eb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventActionVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventActionVisited. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java index a7c5b7ce0ab..d4ec6acead8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventCallout.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventCallout. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java index 583cf8b44bb..5831188a20b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventHandlerVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventHandlerVisited. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java index 7ff90ef64ed..bc2ddd7945b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventNodeVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventNodeVisited. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java index 809aff8862c..fd22e5dc743 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventSearch.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventSearch. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java index cd64051ef8a..a06536a0017 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepAnswered.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventStepAnswered. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java index 8ae72601083..0fd3eb34fc5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputDebugTurnEventTurnEventStepVisited.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** MessageOutputDebugTurnEventTurnEventStepVisited. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java index b1acf4a2df7..170d501947a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageOutputSpelling.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java index b92ea56ac24..736a6fe637e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -18,6 +19,7 @@ public class MessageStatelessOptions extends GenericModel { protected String assistantId; + protected String environmentId; protected StatelessMessageInput input; protected StatelessMessageContext context; protected String userId; @@ -25,6 +27,7 @@ public class MessageStatelessOptions extends GenericModel { /** Builder. */ public static class Builder { private String assistantId; + private String environmentId; private StatelessMessageInput input; private StatelessMessageContext context; private String userId; @@ -36,6 +39,7 @@ public static class Builder { */ private Builder(MessageStatelessOptions messageStatelessOptions) { this.assistantId = messageStatelessOptions.assistantId; + this.environmentId = messageStatelessOptions.environmentId; this.input = messageStatelessOptions.input; this.context = messageStatelessOptions.context; this.userId = messageStatelessOptions.userId; @@ -48,9 +52,11 @@ public Builder() {} * Instantiates a new builder with required properties. * * @param assistantId the assistantId + * @param environmentId the environmentId */ - public Builder(String assistantId) { + public Builder(String assistantId, String environmentId) { this.assistantId = assistantId; + this.environmentId = environmentId; } /** @@ -73,6 +79,17 @@ public Builder assistantId(String assistantId) { return this; } + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the MessageStatelessOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + /** * Set the input. * @@ -112,7 +129,10 @@ protected MessageStatelessOptions() {} protected MessageStatelessOptions(Builder builder) { com.ibm.cloud.sdk.core.util.Validator.notEmpty( builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); assistantId = builder.assistantId; + environmentId = builder.environmentId; input = builder.input; context = builder.context; userId = builder.userId; @@ -148,6 +168,19 @@ public String assistantId() { return assistantId; } + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + /** * Gets the input. * diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionDiskUsage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamMetadata.java similarity index 56% rename from discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionDiskUsage.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamMetadata.java index 0a0ae62edde..1d5999a5cef 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionDiskUsage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,27 +10,28 @@ * 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.ibm.watson.discovery.v1.model; + +package com.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** Summary of the disk usage statistics for this collection. */ -public class CollectionDiskUsage extends GenericModel { +/** Contains meta-information about the item(s) being streamed. */ +public class MessageStreamMetadata extends GenericModel { - @SerializedName("used_bytes") - protected Long usedBytes; + @SerializedName("streaming_metadata") + protected Metadata streamingMetadata; - protected CollectionDiskUsage() {} + protected MessageStreamMetadata() {} /** - * Gets the usedBytes. + * Gets the streamingMetadata. * - *

Number of bytes used by the collection. + *

Contains meta-information about the item(s) being streamed. * - * @return the usedBytes + * @return the streamingMetadata */ - public Long getUsedBytes() { - return usedBytes; + public Metadata getStreamingMetadata() { + return streamingMetadata; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java new file mode 100644 index 00000000000..af36dad5e47 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamOptions.java @@ -0,0 +1,258 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The messageStream options. */ +public class MessageStreamOptions extends GenericModel { + + protected String assistantId; + protected String environmentId; + protected String sessionId; + protected MessageInput input; + protected MessageContext context; + protected String userId; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String environmentId; + private String sessionId; + private MessageInput input; + private MessageContext context; + private String userId; + + /** + * Instantiates a new Builder from an existing MessageStreamOptions instance. + * + * @param messageStreamOptions the instance to initialize the Builder with + */ + private Builder(MessageStreamOptions messageStreamOptions) { + this.assistantId = messageStreamOptions.assistantId; + this.environmentId = messageStreamOptions.environmentId; + this.sessionId = messageStreamOptions.sessionId; + this.input = messageStreamOptions.input; + this.context = messageStreamOptions.context; + this.userId = messageStreamOptions.userId; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param environmentId the environmentId + * @param sessionId the sessionId + */ + public Builder(String assistantId, String environmentId, String sessionId) { + this.assistantId = assistantId; + this.environmentId = environmentId; + this.sessionId = sessionId; + } + + /** + * Builds a MessageStreamOptions. + * + * @return the new MessageStreamOptions instance + */ + public MessageStreamOptions build() { + return new MessageStreamOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the MessageStreamOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the MessageStreamOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Set the sessionId. + * + * @param sessionId the sessionId + * @return the MessageStreamOptions builder + */ + public Builder sessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * Set the input. + * + * @param input the input + * @return the MessageStreamOptions builder + */ + public Builder input(MessageInput input) { + this.input = input; + return this; + } + + /** + * Set the context. + * + * @param context the context + * @return the MessageStreamOptions builder + */ + public Builder context(MessageContext context) { + this.context = context; + return this; + } + + /** + * Set the userId. + * + * @param userId the userId + * @return the MessageStreamOptions builder + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + } + + protected MessageStreamOptions() {} + + protected MessageStreamOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.sessionId, "sessionId cannot be empty"); + assistantId = builder.assistantId; + environmentId = builder.environmentId; + sessionId = builder.sessionId; + input = builder.input; + context = builder.context; + userId = builder.userId; + } + + /** + * New builder. + * + * @return a MessageStreamOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * environment ID of the environment where the assistant is deployed. - For all other requests, + * specify the assistant ID of the assistant. + * + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + + /** + * Gets the sessionId. + * + *

Unique identifier of the session. + * + * @return the sessionId + */ + public String sessionId() { + return sessionId; + } + + /** + * Gets the input. + * + *

An input object that includes the input text. + * + * @return the input + */ + public MessageInput input() { + return input; + } + + /** + * Gets the context. + * + *

Context data for the conversation. You can use this property to set or modify context + * variables, which can also be accessed by dialog nodes. The context is stored by the assistant + * on a per-session basis. + * + *

**Note:** The total size of the context data stored for a stateful session cannot exceed + * 100KB. + * + * @return the context + */ + public MessageContext context() { + return context; + } + + /** + * Gets the userId. + * + *

A string value that identifies the user who is interacting with the assistant. The client + * must provide a unique identifier for each individual end user who accesses the application. For + * user-based plans, this user ID is used to identify unique users for billing purposes. This + * string cannot contain carriage return, newline, or tab characters. If no value is specified in + * the input, **user_id** is automatically set to the value of **context.global.session_id**. + * + *

**Note:** This property is the same as the **user_id** property in the global system + * context. If **user_id** is specified in both locations, the value specified at the root is + * used. + * + * @return the userId + */ + public String userId() { + return userId; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamResponse.java new file mode 100644 index 00000000000..ec46e1f4351 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamResponse.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A streamed response from the watsonx Assistant service. + * + *

Classes which extend this class: - MessageStreamResponseMessageStreamPartialItem - + * MessageStreamResponseMessageStreamCompleteItem - + * MessageStreamResponseStatefulMessageStreamFinalResponse + */ +public class MessageStreamResponse extends GenericModel { + + @SerializedName("partial_item") + protected PartialItem partialItem; + + @SerializedName("complete_item") + protected CompleteItem completeItem; + + @SerializedName("final_response") + protected FinalResponse finalResponse; + + protected MessageStreamResponse() {} + + /** + * Gets the partialItem. + * + *

Message response partial item content. + * + * @return the partialItem + */ + public PartialItem getPartialItem() { + return partialItem; + } + + /** + * Gets the completeItem. + * + * @return the completeItem + */ + public CompleteItem getCompleteItem() { + return completeItem; + } + + /** + * Gets the finalResponse. + * + *

Message final response content. + * + * @return the finalResponse + */ + public FinalResponse getFinalResponse() { + return finalResponse; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java new file mode 100644 index 00000000000..d4e0da7fcbe --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptions.java @@ -0,0 +1,229 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The messageStreamStateless options. */ +public class MessageStreamStatelessOptions extends GenericModel { + + protected String assistantId; + protected String environmentId; + protected MessageInput input; + protected MessageContext context; + protected String userId; + + /** Builder. */ + public static class Builder { + private String assistantId; + private String environmentId; + private MessageInput input; + private MessageContext context; + private String userId; + + /** + * Instantiates a new Builder from an existing MessageStreamStatelessOptions instance. + * + * @param messageStreamStatelessOptions the instance to initialize the Builder with + */ + private Builder(MessageStreamStatelessOptions messageStreamStatelessOptions) { + this.assistantId = messageStreamStatelessOptions.assistantId; + this.environmentId = messageStreamStatelessOptions.environmentId; + this.input = messageStreamStatelessOptions.input; + this.context = messageStreamStatelessOptions.context; + this.userId = messageStreamStatelessOptions.userId; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param assistantId the assistantId + * @param environmentId the environmentId + */ + public Builder(String assistantId, String environmentId) { + this.assistantId = assistantId; + this.environmentId = environmentId; + } + + /** + * Builds a MessageStreamStatelessOptions. + * + * @return the new MessageStreamStatelessOptions instance + */ + public MessageStreamStatelessOptions build() { + return new MessageStreamStatelessOptions(this); + } + + /** + * Set the assistantId. + * + * @param assistantId the assistantId + * @return the MessageStreamStatelessOptions builder + */ + public Builder assistantId(String assistantId) { + this.assistantId = assistantId; + return this; + } + + /** + * Set the environmentId. + * + * @param environmentId the environmentId + * @return the MessageStreamStatelessOptions builder + */ + public Builder environmentId(String environmentId) { + this.environmentId = environmentId; + return this; + } + + /** + * Set the input. + * + * @param input the input + * @return the MessageStreamStatelessOptions builder + */ + public Builder input(MessageInput input) { + this.input = input; + return this; + } + + /** + * Set the context. + * + * @param context the context + * @return the MessageStreamStatelessOptions builder + */ + public Builder context(MessageContext context) { + this.context = context; + return this; + } + + /** + * Set the userId. + * + * @param userId the userId + * @return the MessageStreamStatelessOptions builder + */ + public Builder userId(String userId) { + this.userId = userId; + return this; + } + } + + protected MessageStreamStatelessOptions() {} + + protected MessageStreamStatelessOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.assistantId, "assistantId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.environmentId, "environmentId cannot be empty"); + assistantId = builder.assistantId; + environmentId = builder.environmentId; + input = builder.input; + context = builder.context; + userId = builder.userId; + } + + /** + * New builder. + * + * @return a MessageStreamStatelessOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the assistantId. + * + *

The assistant ID or the environment ID of the environment where the assistant is deployed, + * depending on the type of request: - For message, session, and log requests, specify the + * environment ID of the environment where the assistant is deployed. - For all other requests, + * specify the assistant ID of the assistant. + * + *

To find the environment ID or assistant ID in the watsonx Assistant user interface, open the + * assistant settings and scroll to the **Environments** section. + * + *

**Note:** If you are using the classic Watson Assistant experience, always use the assistant + * ID. To find the assistant ID in the user interface, open the assistant settings and click API + * Details. + * + * @return the assistantId + */ + public String assistantId() { + return assistantId; + } + + /** + * Gets the environmentId. + * + *

Unique identifier of the environment. To find the environment ID in the watsonx Assistant + * user interface, open the environment settings and click **API Details**. **Note:** Currently, + * the API does not support creating environments. + * + * @return the environmentId + */ + public String environmentId() { + return environmentId; + } + + /** + * Gets the input. + * + *

An input object that includes the input text. + * + * @return the input + */ + public MessageInput input() { + return input; + } + + /** + * Gets the context. + * + *

Context data for the conversation. You can use this property to set or modify context + * variables, which can also be accessed by dialog nodes. The context is stored by the assistant + * on a per-session basis. + * + *

**Note:** The total size of the context data stored for a stateful session cannot exceed + * 100KB. + * + * @return the context + */ + public MessageContext context() { + return context; + } + + /** + * Gets the userId. + * + *

A string value that identifies the user who is interacting with the assistant. The client + * must provide a unique identifier for each individual end user who accesses the application. For + * user-based plans, this user ID is used to identify unique users for billing purposes. This + * string cannot contain carriage return, newline, or tab characters. If no value is specified in + * the input, **user_id** is automatically set to the value of **context.global.session_id**. + * + *

**Note:** This property is the same as the **user_id** property in the global system + * context. If **user_id** is specified in both locations, the value specified at the root is + * used. + * + * @return the userId + */ + public String userId() { + return userId; + } +} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Translation.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Metadata.java similarity index 62% rename from language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Translation.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/Metadata.java index aacf250cfed..47c4ec13089 100644 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Translation.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Metadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,25 +10,26 @@ * 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.ibm.watson.language_translator.v3.model; + +package com.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** Translation. */ -public class Translation extends GenericModel { +/** Contains meta-information about the item(s) being streamed. */ +public class Metadata extends GenericModel { - protected String translation; + protected Long id; - protected Translation() {} + protected Metadata() {} /** - * Gets the translation. + * Gets the id. * - *

Translation output in UTF-8. + *

Identifies the index and sequence of the current streamed response item. * - * @return the translation + * @return the id */ - public String getTranslation() { - return translation; + public Long getId() { + return id; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MonitorAssistantReleaseImportArtifactResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MonitorAssistantReleaseImportArtifactResponse.java new file mode 100644 index 00000000000..349643b9b48 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/MonitorAssistantReleaseImportArtifactResponse.java @@ -0,0 +1,160 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Date; +import java.util.List; + +/** MonitorAssistantReleaseImportArtifactResponse. */ +public class MonitorAssistantReleaseImportArtifactResponse extends GenericModel { + + /** + * The current status of the release import process: - **Completed**: The artifact import has + * completed. - **Failed**: The asynchronous artifact import process has failed. - **Processing**: + * An asynchronous operation to import the artifact is underway and not yet completed. + */ + public interface Status { + /** Completed. */ + String COMPLETED = "Completed"; + /** Failed. */ + String FAILED = "Failed"; + /** Processing. */ + String PROCESSING = "Processing"; + } + + /** The type of the skill in the draft environment. */ + public interface SkillImpactInDraft { + /** action. */ + String ACTION = "action"; + /** dialog. */ + String DIALOG = "dialog"; + } + + protected String status; + + @SerializedName("task_id") + protected String taskId; + + @SerializedName("assistant_id") + protected String assistantId; + + @SerializedName("status_errors") + protected List statusErrors; + + @SerializedName("status_description") + protected String statusDescription; + + @SerializedName("skill_impact_in_draft") + protected List skillImpactInDraft; + + protected Date created; + protected Date updated; + + protected MonitorAssistantReleaseImportArtifactResponse() {} + + /** + * Gets the status. + * + *

The current status of the release import process: - **Completed**: The artifact import has + * completed. - **Failed**: The asynchronous artifact import process has failed. - **Processing**: + * An asynchronous operation to import the artifact is underway and not yet completed. + * + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * Gets the taskId. + * + *

A unique identifier for a background asynchronous task that is executing or has executed the + * operation. + * + * @return the taskId + */ + public String getTaskId() { + return taskId; + } + + /** + * Gets the assistantId. + * + *

The ID of the assistant to which the release belongs. + * + * @return the assistantId + */ + public String getAssistantId() { + return assistantId; + } + + /** + * Gets the statusErrors. + * + *

An array of messages about errors that caused an asynchronous operation to fail. Included + * only if **status**=`Failed`. + * + * @return the statusErrors + */ + public List getStatusErrors() { + return statusErrors; + } + + /** + * Gets the statusDescription. + * + *

The description of the failed asynchronous operation. Included only if **status**=`Failed`. + * + * @return the statusDescription + */ + public String getStatusDescription() { + return statusDescription; + } + + /** + * Gets the skillImpactInDraft. + * + *

An array of skill types in the draft environment which will be overridden with skills from + * the artifact being imported. + * + * @return the skillImpactInDraft + */ + public List getSkillImpactInDraft() { + return skillImpactInDraft; + } + + /** + * Gets the created. + * + *

The timestamp for creation of the object. + * + * @return the created + */ + public Date getCreated() { + return created; + } + + /** + * Gets the updated. + * + *

The timestamp for the most recent update to the object. + * + * @return the updated + */ + public Date getUpdated() { + return updated; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java index 7bf1184c574..e2d5eb31534 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Pagination.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/PartialItem.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/PartialItem.java new file mode 100644 index 00000000000..f1ff5d426cd --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/PartialItem.java @@ -0,0 +1,65 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Message response partial item content. */ +public class PartialItem extends GenericModel { + + @SerializedName("response_type") + protected String responseType; + + protected String text; + + @SerializedName("streaming_metadata") + protected Metadata streamingMetadata; + + protected PartialItem() {} + + /** + * Gets the responseType. + * + *

The type of response returned by the dialog node. The specified response type must be + * supported by the client application or channel. + * + * @return the responseType + */ + public String getResponseType() { + return responseType; + } + + /** + * Gets the text. + * + *

The text within the partial chunk of the message stream response. + * + * @return the text + */ + public String getText() { + return text; + } + + /** + * Gets the streamingMetadata. + * + *

Contains meta-information about the item(s) being streamed. + * + * @return the streamingMetadata + */ + public Metadata getStreamingMetadata() { + return streamingMetadata; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2.java new file mode 100644 index 00000000000..88eb0c23ff9 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2.java @@ -0,0 +1,131 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Non-private settings for oauth2 authentication. */ +public class ProviderAuthenticationOAuth2 extends GenericModel { + + /** + * The preferred "flow" or "grant type" for the API client to fetch an access token from the + * authorization server. + */ + public interface PreferredFlow { + /** password. */ + String PASSWORD = "password"; + /** client_credentials. */ + String CLIENT_CREDENTIALS = "client_credentials"; + /** authorization_code. */ + String AUTHORIZATION_CODE = "authorization_code"; + /** <$custom_flow_name>. */ + String CUSTOM_FLOW_NAME = "<$custom_flow_name>"; + } + + @SerializedName("preferred_flow") + protected String preferredFlow; + + protected ProviderAuthenticationOAuth2Flows flows; + + /** Builder. */ + public static class Builder { + private String preferredFlow; + private ProviderAuthenticationOAuth2Flows flows; + + /** + * Instantiates a new Builder from an existing ProviderAuthenticationOAuth2 instance. + * + * @param providerAuthenticationOAuth2 the instance to initialize the Builder with + */ + private Builder(ProviderAuthenticationOAuth2 providerAuthenticationOAuth2) { + this.preferredFlow = providerAuthenticationOAuth2.preferredFlow; + this.flows = providerAuthenticationOAuth2.flows; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderAuthenticationOAuth2. + * + * @return the new ProviderAuthenticationOAuth2 instance + */ + public ProviderAuthenticationOAuth2 build() { + return new ProviderAuthenticationOAuth2(this); + } + + /** + * Set the preferredFlow. + * + * @param preferredFlow the preferredFlow + * @return the ProviderAuthenticationOAuth2 builder + */ + public Builder preferredFlow(String preferredFlow) { + this.preferredFlow = preferredFlow; + return this; + } + + /** + * Set the flows. + * + * @param flows the flows + * @return the ProviderAuthenticationOAuth2 builder + */ + public Builder flows(ProviderAuthenticationOAuth2Flows flows) { + this.flows = flows; + return this; + } + } + + protected ProviderAuthenticationOAuth2() {} + + protected ProviderAuthenticationOAuth2(Builder builder) { + preferredFlow = builder.preferredFlow; + flows = builder.flows; + } + + /** + * New builder. + * + * @return a ProviderAuthenticationOAuth2 builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the preferredFlow. + * + *

The preferred "flow" or "grant type" for the API client to fetch an access token from the + * authorization server. + * + * @return the preferredFlow + */ + public String preferredFlow() { + return preferredFlow; + } + + /** + * Gets the flows. + * + *

Scenarios performed by the API client to fetch an access token from the authorization + * server. + * + * @return the flows + */ + public ProviderAuthenticationOAuth2Flows flows() { + return flows; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2Flows.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2Flows.java new file mode 100644 index 00000000000..c1f213937d7 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2Flows.java @@ -0,0 +1,149 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Scenarios performed by the API client to fetch an access token from the authorization server. + * + *

Classes which extend this class: - + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password - + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials - + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + */ +public class ProviderAuthenticationOAuth2Flows extends GenericModel { + + /** The client authorization type. */ + public interface ClientAuthType { + /** Body. */ + String BODY = "Body"; + /** BasicAuthHeader. */ + String BASICAUTHHEADER = "BasicAuthHeader"; + } + + @SerializedName("token_url") + protected String tokenUrl; + + @SerializedName("refresh_url") + protected String refreshUrl; + + @SerializedName("client_auth_type") + protected String clientAuthType; + + @SerializedName("content_type") + protected String contentType; + + @SerializedName("header_prefix") + protected String headerPrefix; + + protected ProviderAuthenticationOAuth2PasswordUsername username; + + @SerializedName("authorization_url") + protected String authorizationUrl; + + @SerializedName("redirect_uri") + protected String redirectUri; + + protected ProviderAuthenticationOAuth2Flows() {} + + /** + * Gets the tokenUrl. + * + *

The token URL. + * + * @return the tokenUrl + */ + public String tokenUrl() { + return tokenUrl; + } + + /** + * Gets the refreshUrl. + * + *

The refresh token URL. + * + * @return the refreshUrl + */ + public String refreshUrl() { + return refreshUrl; + } + + /** + * Gets the clientAuthType. + * + *

The client authorization type. + * + * @return the clientAuthType + */ + public String clientAuthType() { + return clientAuthType; + } + + /** + * Gets the contentType. + * + *

The content type. + * + * @return the contentType + */ + public String contentType() { + return contentType; + } + + /** + * Gets the headerPrefix. + * + *

The prefix fo the header. + * + * @return the headerPrefix + */ + public String headerPrefix() { + return headerPrefix; + } + + /** + * Gets the username. + * + *

The username for oauth2 authentication when the preferred flow is "password". + * + * @return the username + */ + public ProviderAuthenticationOAuth2PasswordUsername username() { + return username; + } + + /** + * Gets the authorizationUrl. + * + *

The authorization URL. + * + * @return the authorizationUrl + */ + public String authorizationUrl() { + return authorizationUrl; + } + + /** + * Gets the redirectUri. + * + *

The redirect URI. + * + * @return the redirectUri + */ + public String redirectUri() { + return redirectUri; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode.java new file mode 100644 index 00000000000..f4729f54b9a --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode.java @@ -0,0 +1,190 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** Non-private authentication settings for authorization-code flow. */ +public class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + extends ProviderAuthenticationOAuth2Flows { + + /** The client authorization type. */ + public interface ClientAuthType { + /** Body. */ + String BODY = "Body"; + /** BasicAuthHeader. */ + String BASICAUTHHEADER = "BasicAuthHeader"; + } + + /** Builder. */ + public static class Builder { + private String tokenUrl; + private String refreshUrl; + private String clientAuthType; + private String contentType; + private String headerPrefix; + private String authorizationUrl; + private String redirectUri; + + /** + * Instantiates a new Builder from an existing + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode instance. + * + * @param providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode the + * instance to initialize the Builder with + */ + public Builder( + ProviderAuthenticationOAuth2Flows + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode) { + this.tokenUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode.tokenUrl; + this.refreshUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode.refreshUrl; + this.clientAuthType = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .clientAuthType; + this.contentType = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .contentType; + this.headerPrefix = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .headerPrefix; + this.authorizationUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .authorizationUrl; + this.redirectUri = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .redirectUri; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode. + * + * @return the new + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode instance + */ + public ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode build() { + return new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode( + this); + } + + /** + * Set the tokenUrl. + * + * @param tokenUrl the tokenUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder tokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * Set the refreshUrl. + * + * @param refreshUrl the refreshUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder refreshUrl(String refreshUrl) { + this.refreshUrl = refreshUrl; + return this; + } + + /** + * Set the clientAuthType. + * + * @param clientAuthType the clientAuthType + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder clientAuthType(String clientAuthType) { + this.clientAuthType = clientAuthType; + return this; + } + + /** + * Set the contentType. + * + * @param contentType the contentType + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Set the headerPrefix. + * + * @param headerPrefix the headerPrefix + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder headerPrefix(String headerPrefix) { + this.headerPrefix = headerPrefix; + return this; + } + + /** + * Set the authorizationUrl. + * + * @param authorizationUrl the authorizationUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder authorizationUrl(String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + /** + * Set the redirectUri. + * + * @param redirectUri the redirectUri + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder redirectUri(String redirectUri) { + this.redirectUri = redirectUri; + return this; + } + } + + protected ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode() {} + + protected ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode( + Builder builder) { + tokenUrl = builder.tokenUrl; + refreshUrl = builder.refreshUrl; + clientAuthType = builder.clientAuthType; + contentType = builder.contentType; + headerPrefix = builder.headerPrefix; + authorizationUrl = builder.authorizationUrl; + redirectUri = builder.redirectUri; + } + + /** + * New builder. + * + * @return a ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials.java new file mode 100644 index 00000000000..f4f9b82debe --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials. */ +public class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + extends ProviderAuthenticationOAuth2Flows { + + /** The client authorization type. */ + public interface ClientAuthType { + /** Body. */ + String BODY = "Body"; + /** BasicAuthHeader. */ + String BASICAUTHHEADER = "BasicAuthHeader"; + } + + /** Builder. */ + public static class Builder { + private String tokenUrl; + private String refreshUrl; + private String clientAuthType; + private String contentType; + private String headerPrefix; + + /** + * Instantiates a new Builder from an existing + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials instance. + * + * @param providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials the + * instance to initialize the Builder with + */ + public Builder( + ProviderAuthenticationOAuth2Flows + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials) { + this.tokenUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials.tokenUrl; + this.refreshUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials.refreshUrl; + this.clientAuthType = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + .clientAuthType; + this.contentType = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + .contentType; + this.headerPrefix = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + .headerPrefix; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials. + * + * @return the new + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials instance + */ + public ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials build() { + return new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials( + this); + } + + /** + * Set the tokenUrl. + * + * @param tokenUrl the tokenUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder tokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * Set the refreshUrl. + * + * @param refreshUrl the refreshUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder refreshUrl(String refreshUrl) { + this.refreshUrl = refreshUrl; + return this; + } + + /** + * Set the clientAuthType. + * + * @param clientAuthType the clientAuthType + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder clientAuthType(String clientAuthType) { + this.clientAuthType = clientAuthType; + return this; + } + + /** + * Set the contentType. + * + * @param contentType the contentType + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Set the headerPrefix. + * + * @param headerPrefix the headerPrefix + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder headerPrefix(String headerPrefix) { + this.headerPrefix = headerPrefix; + return this; + } + } + + protected ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials() {} + + protected ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials( + Builder builder) { + tokenUrl = builder.tokenUrl; + refreshUrl = builder.refreshUrl; + clientAuthType = builder.clientAuthType; + contentType = builder.contentType; + headerPrefix = builder.headerPrefix; + } + + /** + * New builder. + * + * @return a ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.java new file mode 100644 index 00000000000..ea2133b60f4 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.java @@ -0,0 +1,160 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** Non-private authentication settings for resource owner password flow. */ +public class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + extends ProviderAuthenticationOAuth2Flows { + + /** The client authorization type. */ + public interface ClientAuthType { + /** Body. */ + String BODY = "Body"; + /** BasicAuthHeader. */ + String BASICAUTHHEADER = "BasicAuthHeader"; + } + + /** Builder. */ + public static class Builder { + private String tokenUrl; + private String refreshUrl; + private String clientAuthType; + private String contentType; + private String headerPrefix; + private ProviderAuthenticationOAuth2PasswordUsername username; + + /** + * Instantiates a new Builder from an existing + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password instance. + * + * @param providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password the instance to + * initialize the Builder with + */ + public Builder( + ProviderAuthenticationOAuth2Flows + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password) { + this.tokenUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.tokenUrl; + this.refreshUrl = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.refreshUrl; + this.clientAuthType = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.clientAuthType; + this.contentType = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.contentType; + this.headerPrefix = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.headerPrefix; + this.username = + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.username; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password. + * + * @return the new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + * instance + */ + public ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password build() { + return new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password(this); + } + + /** + * Set the tokenUrl. + * + * @param tokenUrl the tokenUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder tokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * Set the refreshUrl. + * + * @param refreshUrl the refreshUrl + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder refreshUrl(String refreshUrl) { + this.refreshUrl = refreshUrl; + return this; + } + + /** + * Set the clientAuthType. + * + * @param clientAuthType the clientAuthType + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder clientAuthType(String clientAuthType) { + this.clientAuthType = clientAuthType; + return this; + } + + /** + * Set the contentType. + * + * @param contentType the contentType + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder contentType(String contentType) { + this.contentType = contentType; + return this; + } + + /** + * Set the headerPrefix. + * + * @param headerPrefix the headerPrefix + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder headerPrefix(String headerPrefix) { + this.headerPrefix = headerPrefix; + return this; + } + + /** + * Set the username. + * + * @param username the username + * @return the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder username(ProviderAuthenticationOAuth2PasswordUsername username) { + this.username = username; + return this; + } + } + + protected ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password() {} + + protected ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password(Builder builder) { + tokenUrl = builder.tokenUrl; + refreshUrl = builder.refreshUrl; + clientAuthType = builder.clientAuthType; + contentType = builder.contentType; + headerPrefix = builder.headerPrefix; + username = builder.username; + } + + /** + * New builder. + * + * @return a ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2PasswordUsername.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2PasswordUsername.java new file mode 100644 index 00000000000..787ff4f82e1 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2PasswordUsername.java @@ -0,0 +1,120 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The username for oauth2 authentication when the preferred flow is "password". */ +public class ProviderAuthenticationOAuth2PasswordUsername extends GenericModel { + + /** The type of property observed in "value". */ + public interface Type { + /** value. */ + String VALUE = "value"; + } + + protected String type; + protected String value; + + /** Builder. */ + public static class Builder { + private String type; + private String value; + + /** + * Instantiates a new Builder from an existing ProviderAuthenticationOAuth2PasswordUsername + * instance. + * + * @param providerAuthenticationOAuth2PasswordUsername the instance to initialize the Builder + * with + */ + private Builder( + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsername) { + this.type = providerAuthenticationOAuth2PasswordUsername.type; + this.value = providerAuthenticationOAuth2PasswordUsername.value; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderAuthenticationOAuth2PasswordUsername. + * + * @return the new ProviderAuthenticationOAuth2PasswordUsername instance + */ + public ProviderAuthenticationOAuth2PasswordUsername build() { + return new ProviderAuthenticationOAuth2PasswordUsername(this); + } + + /** + * Set the type. + * + * @param type the type + * @return the ProviderAuthenticationOAuth2PasswordUsername builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the ProviderAuthenticationOAuth2PasswordUsername builder + */ + public Builder value(String value) { + this.value = value; + return this; + } + } + + protected ProviderAuthenticationOAuth2PasswordUsername() {} + + protected ProviderAuthenticationOAuth2PasswordUsername(Builder builder) { + type = builder.type; + value = builder.value; + } + + /** + * New builder. + * + * @return a ProviderAuthenticationOAuth2PasswordUsername builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the type. + * + *

The type of property observed in "value". + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the value. + * + *

The stored information of the value. + * + * @return the value + */ + public String value() { + return value; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationTypeAndValue.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationTypeAndValue.java new file mode 100644 index 00000000000..ab74a9f0fbb --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationTypeAndValue.java @@ -0,0 +1,117 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** ProviderAuthenticationTypeAndValue. */ +public class ProviderAuthenticationTypeAndValue extends GenericModel { + + /** The type of property observed in "value". */ + public interface Type { + /** value. */ + String VALUE = "value"; + } + + protected String type; + protected String value; + + /** Builder. */ + public static class Builder { + private String type; + private String value; + + /** + * Instantiates a new Builder from an existing ProviderAuthenticationTypeAndValue instance. + * + * @param providerAuthenticationTypeAndValue the instance to initialize the Builder with + */ + private Builder(ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValue) { + this.type = providerAuthenticationTypeAndValue.type; + this.value = providerAuthenticationTypeAndValue.value; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderAuthenticationTypeAndValue. + * + * @return the new ProviderAuthenticationTypeAndValue instance + */ + public ProviderAuthenticationTypeAndValue build() { + return new ProviderAuthenticationTypeAndValue(this); + } + + /** + * Set the type. + * + * @param type the type + * @return the ProviderAuthenticationTypeAndValue builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the ProviderAuthenticationTypeAndValue builder + */ + public Builder value(String value) { + this.value = value; + return this; + } + } + + protected ProviderAuthenticationTypeAndValue() {} + + protected ProviderAuthenticationTypeAndValue(Builder builder) { + type = builder.type; + value = builder.value; + } + + /** + * New builder. + * + * @return a ProviderAuthenticationTypeAndValue builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the type. + * + *

The type of property observed in "value". + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the value. + * + *

The stored information of the value. + * + * @return the value + */ + public String value() { + return value; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderCollection.java new file mode 100644 index 00000000000..f7b90e6e949 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderCollection.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** ProviderCollection. */ +public class ProviderCollection extends GenericModel { + + @SerializedName("conversational_skill_providers") + protected List conversationalSkillProviders; + + protected Pagination pagination; + + protected ProviderCollection() {} + + /** + * Gets the conversationalSkillProviders. + * + *

An array of objects describing the conversational skill providers associated with the + * instance. + * + * @return the conversationalSkillProviders + */ + public List getConversationalSkillProviders() { + return conversationalSkillProviders; + } + + /** + * Gets the pagination. + * + *

The pagination data for the returned objects. For more information about using pagination, + * see [Pagination](#pagination). + * + * @return the pagination + */ + public Pagination getPagination() { + return pagination; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivate.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivate.java new file mode 100644 index 00000000000..ef650939786 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivate.java @@ -0,0 +1,96 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Private information of the provider. */ +public class ProviderPrivate extends GenericModel { + + protected ProviderPrivateAuthentication authentication; + + /** Builder. */ + public static class Builder { + private ProviderPrivateAuthentication authentication; + + /** + * Instantiates a new Builder from an existing ProviderPrivate instance. + * + * @param providerPrivate the instance to initialize the Builder with + */ + private Builder(ProviderPrivate providerPrivate) { + this.authentication = providerPrivate.authentication; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param authentication the authentication + */ + public Builder(ProviderPrivateAuthentication authentication) { + this.authentication = authentication; + } + + /** + * Builds a ProviderPrivate. + * + * @return the new ProviderPrivate instance + */ + public ProviderPrivate build() { + return new ProviderPrivate(this); + } + + /** + * Set the authentication. + * + * @param authentication the authentication + * @return the ProviderPrivate builder + */ + public Builder authentication(ProviderPrivateAuthentication authentication) { + this.authentication = authentication; + return this; + } + } + + protected ProviderPrivate() {} + + protected ProviderPrivate(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.authentication, "authentication cannot be null"); + authentication = builder.authentication; + } + + /** + * New builder. + * + * @return a ProviderPrivate builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the authentication. + * + *

Private authentication information of the provider. + * + * @return the authentication + */ + public ProviderPrivateAuthentication authentication() { + return authentication; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthentication.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthentication.java new file mode 100644 index 00000000000..ccc23d2f4c5 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthentication.java @@ -0,0 +1,65 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Private authentication information of the provider. + * + *

Classes which extend this class: - ProviderPrivateAuthenticationBearerFlow - + * ProviderPrivateAuthenticationBasicFlow - ProviderPrivateAuthenticationOAuth2Flow + */ +public class ProviderPrivateAuthentication extends GenericModel { + + protected ProviderAuthenticationTypeAndValue token; + protected ProviderAuthenticationTypeAndValue password; + protected ProviderPrivateAuthenticationOAuth2FlowFlows flows; + + protected ProviderPrivateAuthentication() {} + + /** + * Gets the token. + * + *

The token for bearer authentication. + * + * @return the token + */ + public ProviderAuthenticationTypeAndValue token() { + return token; + } + + /** + * Gets the password. + * + *

The password for bearer authentication. + * + * @return the password + */ + public ProviderAuthenticationTypeAndValue password() { + return password; + } + + /** + * Gets the flows. + * + *

Scenarios performed by the API client to fetch an access token from the authorization + * server. + * + * @return the flows + */ + public ProviderPrivateAuthenticationOAuth2FlowFlows flows() { + return flows; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBasicFlow.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBasicFlow.java new file mode 100644 index 00000000000..1dd3fdc0272 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBasicFlow.java @@ -0,0 +1,70 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** The private data for basic authentication. */ +public class ProviderPrivateAuthenticationBasicFlow extends ProviderPrivateAuthentication { + + /** Builder. */ + public static class Builder { + private ProviderAuthenticationTypeAndValue password; + + /** + * Instantiates a new Builder from an existing ProviderPrivateAuthenticationBasicFlow instance. + * + * @param providerPrivateAuthenticationBasicFlow the instance to initialize the Builder with + */ + public Builder(ProviderPrivateAuthentication providerPrivateAuthenticationBasicFlow) { + this.password = providerPrivateAuthenticationBasicFlow.password; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderPrivateAuthenticationBasicFlow. + * + * @return the new ProviderPrivateAuthenticationBasicFlow instance + */ + public ProviderPrivateAuthenticationBasicFlow build() { + return new ProviderPrivateAuthenticationBasicFlow(this); + } + + /** + * Set the password. + * + * @param password the password + * @return the ProviderPrivateAuthenticationBasicFlow builder + */ + public Builder password(ProviderAuthenticationTypeAndValue password) { + this.password = password; + return this; + } + } + + protected ProviderPrivateAuthenticationBasicFlow() {} + + protected ProviderPrivateAuthenticationBasicFlow(Builder builder) { + password = builder.password; + } + + /** + * New builder. + * + * @return a ProviderPrivateAuthenticationBasicFlow builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBearerFlow.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBearerFlow.java new file mode 100644 index 00000000000..5933c815f5a --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBearerFlow.java @@ -0,0 +1,70 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** The private data for bearer authentication. */ +public class ProviderPrivateAuthenticationBearerFlow extends ProviderPrivateAuthentication { + + /** Builder. */ + public static class Builder { + private ProviderAuthenticationTypeAndValue token; + + /** + * Instantiates a new Builder from an existing ProviderPrivateAuthenticationBearerFlow instance. + * + * @param providerPrivateAuthenticationBearerFlow the instance to initialize the Builder with + */ + public Builder(ProviderPrivateAuthentication providerPrivateAuthenticationBearerFlow) { + this.token = providerPrivateAuthenticationBearerFlow.token; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderPrivateAuthenticationBearerFlow. + * + * @return the new ProviderPrivateAuthenticationBearerFlow instance + */ + public ProviderPrivateAuthenticationBearerFlow build() { + return new ProviderPrivateAuthenticationBearerFlow(this); + } + + /** + * Set the token. + * + * @param token the token + * @return the ProviderPrivateAuthenticationBearerFlow builder + */ + public Builder token(ProviderAuthenticationTypeAndValue token) { + this.token = token; + return this; + } + } + + protected ProviderPrivateAuthenticationBearerFlow() {} + + protected ProviderPrivateAuthenticationBearerFlow(Builder builder) { + token = builder.token; + } + + /** + * New builder. + * + * @return a ProviderPrivateAuthenticationBearerFlow builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2Flow.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2Flow.java new file mode 100644 index 00000000000..2d45b3cb906 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2Flow.java @@ -0,0 +1,70 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** The private data for oauth2 authentication. */ +public class ProviderPrivateAuthenticationOAuth2Flow extends ProviderPrivateAuthentication { + + /** Builder. */ + public static class Builder { + private ProviderPrivateAuthenticationOAuth2FlowFlows flows; + + /** + * Instantiates a new Builder from an existing ProviderPrivateAuthenticationOAuth2Flow instance. + * + * @param providerPrivateAuthenticationOAuth2Flow the instance to initialize the Builder with + */ + public Builder(ProviderPrivateAuthentication providerPrivateAuthenticationOAuth2Flow) { + this.flows = providerPrivateAuthenticationOAuth2Flow.flows; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderPrivateAuthenticationOAuth2Flow. + * + * @return the new ProviderPrivateAuthenticationOAuth2Flow instance + */ + public ProviderPrivateAuthenticationOAuth2Flow build() { + return new ProviderPrivateAuthenticationOAuth2Flow(this); + } + + /** + * Set the flows. + * + * @param flows the flows + * @return the ProviderPrivateAuthenticationOAuth2Flow builder + */ + public Builder flows(ProviderPrivateAuthenticationOAuth2FlowFlows flows) { + this.flows = flows; + return this; + } + } + + protected ProviderPrivateAuthenticationOAuth2Flow() {} + + protected ProviderPrivateAuthenticationOAuth2Flow(Builder builder) { + flows = builder.flows; + } + + /** + * New builder. + * + * @return a ProviderPrivateAuthenticationOAuth2Flow builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlows.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlows.java new file mode 100644 index 00000000000..540d0eeef0d --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlows.java @@ -0,0 +1,114 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * Scenarios performed by the API client to fetch an access token from the authorization server. + * + *

Classes which extend this class: - + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password - + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * - + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + */ +public class ProviderPrivateAuthenticationOAuth2FlowFlows extends GenericModel { + + @SerializedName("client_id") + protected String clientId; + + @SerializedName("client_secret") + protected String clientSecret; + + @SerializedName("access_token") + protected String accessToken; + + @SerializedName("refresh_token") + protected String refreshToken; + + protected ProviderPrivateAuthenticationOAuth2PasswordPassword password; + + @SerializedName("authorization_code") + protected String authorizationCode; + + protected ProviderPrivateAuthenticationOAuth2FlowFlows() {} + + /** + * Gets the clientId. + * + *

The client ID. + * + * @return the clientId + */ + public String clientId() { + return clientId; + } + + /** + * Gets the clientSecret. + * + *

The client secret. + * + * @return the clientSecret + */ + public String clientSecret() { + return clientSecret; + } + + /** + * Gets the accessToken. + * + *

The access token. + * + * @return the accessToken + */ + public String accessToken() { + return accessToken; + } + + /** + * Gets the refreshToken. + * + *

The refresh token. + * + * @return the refreshToken + */ + public String refreshToken() { + return refreshToken; + } + + /** + * Gets the password. + * + *

The password for oauth2 authentication when the preferred flow is "password". + * + * @return the password + */ + public ProviderPrivateAuthenticationOAuth2PasswordPassword password() { + return password; + } + + /** + * Gets the authorizationCode. + * + *

The authorization code. + * + * @return the authorizationCode + */ + public String authorizationCode() { + return authorizationCode; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode.java new file mode 100644 index 00000000000..876c3138452 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode.java @@ -0,0 +1,165 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** Private authentication settings for client credentials flow. */ +public +class ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + extends ProviderPrivateAuthenticationOAuth2FlowFlows { + + /** Builder. */ + public static class Builder { + private String clientId; + private String clientSecret; + private String accessToken; + private String refreshToken; + private String authorizationCode; + + /** + * Instantiates a new Builder from an existing + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * instance. + * + * @param + * providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * the instance to initialize the Builder with + */ + public Builder( + ProviderPrivateAuthenticationOAuth2FlowFlows + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode) { + this.clientId = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .clientId; + this.clientSecret = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .clientSecret; + this.accessToken = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .accessToken; + this.refreshToken = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .refreshToken; + this.authorizationCode = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .authorizationCode; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode. + * + * @return the new + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * instance + */ + public + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + build() { + return new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode( + this); + } + + /** + * Set the clientId. + * + * @param clientId the clientId + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Set the clientSecret. + * + * @param clientSecret the clientSecret + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder clientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Set the accessToken. + * + * @param accessToken the accessToken + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder accessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Set the refreshToken. + * + * @param refreshToken the refreshToken + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder refreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Set the authorizationCode. + * + * @param authorizationCode the authorizationCode + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder authorizationCode(String authorizationCode) { + this.authorizationCode = authorizationCode; + return this; + } + } + + protected + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode() {} + + protected + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode( + Builder builder) { + clientId = builder.clientId; + clientSecret = builder.clientSecret; + accessToken = builder.accessToken; + refreshToken = builder.refreshToken; + authorizationCode = builder.authorizationCode; + } + + /** + * New builder. + * + * @return a + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials.java new file mode 100644 index 00000000000..ad273689af1 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials.java @@ -0,0 +1,149 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials. + */ +public +class ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + extends ProviderPrivateAuthenticationOAuth2FlowFlows { + + /** Builder. */ + public static class Builder { + private String clientId; + private String clientSecret; + private String accessToken; + private String refreshToken; + + /** + * Instantiates a new Builder from an existing + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * instance. + * + * @param + * providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * the instance to initialize the Builder with + */ + public Builder( + ProviderPrivateAuthenticationOAuth2FlowFlows + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials) { + this.clientId = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + .clientId; + this.clientSecret = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + .clientSecret; + this.accessToken = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + .accessToken; + this.refreshToken = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + .refreshToken; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials. + * + * @return the new + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * instance + */ + public + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + build() { + return new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials( + this); + } + + /** + * Set the clientId. + * + * @param clientId the clientId + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Set the clientSecret. + * + * @param clientSecret the clientSecret + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder clientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Set the accessToken. + * + * @param accessToken the accessToken + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder accessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Set the refreshToken. + * + * @param refreshToken the refreshToken + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder refreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + } + + protected + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials() {} + + protected + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials( + Builder builder) { + clientId = builder.clientId; + clientSecret = builder.clientSecret; + accessToken = builder.accessToken; + refreshToken = builder.refreshToken; + } + + /** + * New builder. + * + * @return a + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password.java new file mode 100644 index 00000000000..70c5031d22d --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password.java @@ -0,0 +1,162 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +/** Private authentication settings for resource owner password flow. */ +public class ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + extends ProviderPrivateAuthenticationOAuth2FlowFlows { + + /** Builder. */ + public static class Builder { + private String clientId; + private String clientSecret; + private String accessToken; + private String refreshToken; + private ProviderPrivateAuthenticationOAuth2PasswordPassword password; + + /** + * Instantiates a new Builder from an existing + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * instance. + * + * @param + * providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * the instance to initialize the Builder with + */ + public Builder( + ProviderPrivateAuthenticationOAuth2FlowFlows + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password) { + this.clientId = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .clientId; + this.clientSecret = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .clientSecret; + this.accessToken = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .accessToken; + this.refreshToken = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .refreshToken; + this.password = + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .password; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password. + * + * @return the new + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * instance + */ + public ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + build() { + return new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password( + this); + } + + /** + * Set the clientId. + * + * @param clientId the clientId + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * builder + */ + public Builder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Set the clientSecret. + * + * @param clientSecret the clientSecret + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * builder + */ + public Builder clientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Set the accessToken. + * + * @param accessToken the accessToken + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * builder + */ + public Builder accessToken(String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Set the refreshToken. + * + * @param refreshToken the refreshToken + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * builder + */ + public Builder refreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Set the password. + * + * @param password the password + * @return the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * builder + */ + public Builder password(ProviderPrivateAuthenticationOAuth2PasswordPassword password) { + this.password = password; + return this; + } + } + + protected + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password() {} + + protected ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password( + Builder builder) { + clientId = builder.clientId; + clientSecret = builder.clientSecret; + accessToken = builder.accessToken; + refreshToken = builder.refreshToken; + password = builder.password; + } + + /** + * New builder. + * + * @return a + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + * builder + */ + public Builder newBuilder() { + return new Builder(this); + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2PasswordPassword.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2PasswordPassword.java new file mode 100644 index 00000000000..d2ced7cb911 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2PasswordPassword.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The password for oauth2 authentication when the preferred flow is "password". */ +public class ProviderPrivateAuthenticationOAuth2PasswordPassword extends GenericModel { + + /** The type of property observed in "value". */ + public interface Type { + /** value. */ + String VALUE = "value"; + } + + protected String type; + protected String value; + + /** Builder. */ + public static class Builder { + private String type; + private String value; + + /** + * Instantiates a new Builder from an existing + * ProviderPrivateAuthenticationOAuth2PasswordPassword instance. + * + * @param providerPrivateAuthenticationOAuth2PasswordPassword the instance to initialize the + * Builder with + */ + private Builder( + ProviderPrivateAuthenticationOAuth2PasswordPassword + providerPrivateAuthenticationOAuth2PasswordPassword) { + this.type = providerPrivateAuthenticationOAuth2PasswordPassword.type; + this.value = providerPrivateAuthenticationOAuth2PasswordPassword.value; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderPrivateAuthenticationOAuth2PasswordPassword. + * + * @return the new ProviderPrivateAuthenticationOAuth2PasswordPassword instance + */ + public ProviderPrivateAuthenticationOAuth2PasswordPassword build() { + return new ProviderPrivateAuthenticationOAuth2PasswordPassword(this); + } + + /** + * Set the type. + * + * @param type the type + * @return the ProviderPrivateAuthenticationOAuth2PasswordPassword builder + */ + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * Set the value. + * + * @param value the value + * @return the ProviderPrivateAuthenticationOAuth2PasswordPassword builder + */ + public Builder value(String value) { + this.value = value; + return this; + } + } + + protected ProviderPrivateAuthenticationOAuth2PasswordPassword() {} + + protected ProviderPrivateAuthenticationOAuth2PasswordPassword(Builder builder) { + type = builder.type; + value = builder.value; + } + + /** + * New builder. + * + * @return a ProviderPrivateAuthenticationOAuth2PasswordPassword builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the type. + * + *

The type of property observed in "value". + * + * @return the type + */ + public String type() { + return type; + } + + /** + * Gets the value. + * + *

The stored information of the value. + * + * @return the value + */ + public String value() { + return value; + } +} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GatewayDelete.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponse.java similarity index 52% rename from discovery/src/main/java/com/ibm/watson/discovery/v1/model/GatewayDelete.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponse.java index 7c66c36a8cd..3ae192e88fe 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GatewayDelete.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,40 +10,41 @@ * 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.ibm.watson.discovery.v1.model; + +package com.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** Gatway deletion confirmation. */ -public class GatewayDelete extends GenericModel { +/** ProviderResponse. */ +public class ProviderResponse extends GenericModel { - @SerializedName("gateway_id") - protected String gatewayId; + @SerializedName("provider_id") + protected String providerId; - protected String status; + protected ProviderResponseSpecification specification; - protected GatewayDelete() {} + protected ProviderResponse() {} /** - * Gets the gatewayId. + * Gets the providerId. * - *

The gateway ID of the deleted gateway. + *

The unique identifier of the provider. * - * @return the gatewayId + * @return the providerId */ - public String getGatewayId() { - return gatewayId; + public String getProviderId() { + return providerId; } /** - * Gets the status. + * Gets the specification. * - *

The status of the request. + *

The specification of the provider. * - * @return the status + * @return the specification */ - public String getStatus() { - return status; + public ProviderResponseSpecification getSpecification() { + return specification; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecification.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecification.java new file mode 100644 index 00000000000..45e497da7f3 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecification.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; + +/** The specification of the provider. */ +public class ProviderResponseSpecification extends GenericModel { + + protected List servers; + protected ProviderResponseSpecificationComponents components; + + protected ProviderResponseSpecification() {} + + /** + * Gets the servers. + * + *

An array of objects defining all endpoints of the provider. + * + *

**Note:** Multiple array items are reserved for future use. + * + * @return the servers + */ + public List getServers() { + return servers; + } + + /** + * Gets the components. + * + *

An object defining various reusable definitions of the provider. + * + * @return the components + */ + public ProviderResponseSpecificationComponents getComponents() { + return components; + } +} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponents.java similarity index 51% rename from language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguage.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponents.java index dfc54ef1843..75c886cd237 100644 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponents.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,37 +10,26 @@ * 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.ibm.watson.language_translator.v3.model; -import com.ibm.cloud.sdk.core.service.model.GenericModel; +package com.ibm.watson.assistant.v2.model; -/** IdentifiableLanguage. */ -public class IdentifiableLanguage extends GenericModel { +import com.ibm.cloud.sdk.core.service.model.GenericModel; - protected String language; - protected String name; +/** An object defining various reusable definitions of the provider. */ +public class ProviderResponseSpecificationComponents extends GenericModel { - protected IdentifiableLanguage() {} + protected ProviderResponseSpecificationComponentsSecuritySchemes securitySchemes; - /** - * Gets the language. - * - *

The language code for an identifiable language. - * - * @return the language - */ - public String getLanguage() { - return language; - } + protected ProviderResponseSpecificationComponents() {} /** - * Gets the name. + * Gets the securitySchemes. * - *

The name of the identifiable language. + *

The definition of the security scheme for the provider. * - * @return the name + * @return the securitySchemes */ - public String getName() { - return name; + public ProviderResponseSpecificationComponentsSecuritySchemes getSecuritySchemes() { + return securitySchemes; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemes.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemes.java new file mode 100644 index 00000000000..f7d5c1133b4 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemes.java @@ -0,0 +1,80 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The definition of the security scheme for the provider. */ +public class ProviderResponseSpecificationComponentsSecuritySchemes extends GenericModel { + + /** + * The authentication method required for requests made from watsonx Assistant to the + * conversational skill provider. + */ + public interface AuthenticationMethod { + /** basic. */ + String BASIC = "basic"; + /** bearer. */ + String BEARER = "bearer"; + /** api_key. */ + String API_KEY = "api_key"; + /** oauth2. */ + String OAUTH2 = "oauth2"; + /** none. */ + String NONE = "none"; + } + + @SerializedName("authentication_method") + protected String authenticationMethod; + + protected ProviderResponseSpecificationComponentsSecuritySchemesBasic basic; + protected ProviderAuthenticationOAuth2 oauth2; + + protected ProviderResponseSpecificationComponentsSecuritySchemes() {} + + /** + * Gets the authenticationMethod. + * + *

The authentication method required for requests made from watsonx Assistant to the + * conversational skill provider. + * + * @return the authenticationMethod + */ + public String getAuthenticationMethod() { + return authenticationMethod; + } + + /** + * Gets the basic. + * + *

Non-private settings for basic access authentication. + * + * @return the basic + */ + public ProviderResponseSpecificationComponentsSecuritySchemesBasic getBasic() { + return basic; + } + + /** + * Gets the oauth2. + * + *

Non-private settings for oauth2 authentication. + * + * @return the oauth2 + */ + public ProviderAuthenticationOAuth2 getOauth2() { + return oauth2; + } +} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialsList.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesBasic.java similarity index 53% rename from discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialsList.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesBasic.java index 6db9646c4f5..1e9f36be757 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialsList.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesBasic.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,26 +10,26 @@ * 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.ibm.watson.discovery.v1.model; + +package com.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; -/** Object containing array of credential definitions. */ -public class CredentialsList extends GenericModel { +/** Non-private settings for basic access authentication. */ +public class ProviderResponseSpecificationComponentsSecuritySchemesBasic extends GenericModel { - protected List credentials; + protected ProviderAuthenticationTypeAndValue username; - protected CredentialsList() {} + protected ProviderResponseSpecificationComponentsSecuritySchemesBasic() {} /** - * Gets the credentials. + * Gets the username. * - *

An array of credential definitions that were created for this instance. + *

The username for basic access authentication. * - * @return the credentials + * @return the username */ - public List getCredentials() { - return credentials; + public ProviderAuthenticationTypeAndValue getUsername() { + return username; } } diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteModelResult.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationServersItem.java similarity index 60% rename from language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteModelResult.java rename to assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationServersItem.java index aad668d4c54..71b5ac1151b 100644 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteModelResult.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationServersItem.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,25 +10,26 @@ * 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.ibm.watson.language_translator.v3.model; + +package com.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** DeleteModelResult. */ -public class DeleteModelResult extends GenericModel { +/** ProviderResponseSpecificationServersItem. */ +public class ProviderResponseSpecificationServersItem extends GenericModel { - protected String status; + protected String url; - protected DeleteModelResult() {} + protected ProviderResponseSpecificationServersItem() {} /** - * Gets the status. + * Gets the url. * - *

"OK" indicates that the model was successfully deleted. + *

The URL of the conversational skill provider. * - * @return the status + * @return the url */ - public String getStatus() { - return status; + public String getUrl() { + return url; } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecification.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecification.java new file mode 100644 index 00000000000..21afa8cfb28 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecification.java @@ -0,0 +1,140 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.ArrayList; +import java.util.List; + +/** The specification of the provider. */ +public class ProviderSpecification extends GenericModel { + + protected List servers; + protected ProviderSpecificationComponents components; + + /** Builder. */ + public static class Builder { + private List servers; + private ProviderSpecificationComponents components; + + /** + * Instantiates a new Builder from an existing ProviderSpecification instance. + * + * @param providerSpecification the instance to initialize the Builder with + */ + private Builder(ProviderSpecification providerSpecification) { + this.servers = providerSpecification.servers; + this.components = providerSpecification.components; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param servers the servers + */ + public Builder(List servers) { + this.servers = servers; + } + + /** + * Builds a ProviderSpecification. + * + * @return the new ProviderSpecification instance + */ + public ProviderSpecification build() { + return new ProviderSpecification(this); + } + + /** + * Adds a new element to servers. + * + * @param servers the new element to be added + * @return the ProviderSpecification builder + */ + public Builder addServers(ProviderSpecificationServersItem servers) { + com.ibm.cloud.sdk.core.util.Validator.notNull(servers, "servers cannot be null"); + if (this.servers == null) { + this.servers = new ArrayList(); + } + this.servers.add(servers); + return this; + } + + /** + * Set the servers. Existing servers will be replaced. + * + * @param servers the servers + * @return the ProviderSpecification builder + */ + public Builder servers(List servers) { + this.servers = servers; + return this; + } + + /** + * Set the components. + * + * @param components the components + * @return the ProviderSpecification builder + */ + public Builder components(ProviderSpecificationComponents components) { + this.components = components; + return this; + } + } + + protected ProviderSpecification() {} + + protected ProviderSpecification(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.servers, "servers cannot be null"); + servers = builder.servers; + components = builder.components; + } + + /** + * New builder. + * + * @return a ProviderSpecification builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the servers. + * + *

An array of objects defining all endpoints of the provider. + * + *

**Note:** Multiple array items are reserved for future use. + * + * @return the servers + */ + public List servers() { + return servers; + } + + /** + * Gets the components. + * + *

An object defining various reusable definitions of the provider. + * + * @return the components + */ + public ProviderSpecificationComponents components() { + return components; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponents.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponents.java new file mode 100644 index 00000000000..b82d934c83b --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponents.java @@ -0,0 +1,85 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** An object defining various reusable definitions of the provider. */ +public class ProviderSpecificationComponents extends GenericModel { + + protected ProviderSpecificationComponentsSecuritySchemes securitySchemes; + + /** Builder. */ + public static class Builder { + private ProviderSpecificationComponentsSecuritySchemes securitySchemes; + + /** + * Instantiates a new Builder from an existing ProviderSpecificationComponents instance. + * + * @param providerSpecificationComponents the instance to initialize the Builder with + */ + private Builder(ProviderSpecificationComponents providerSpecificationComponents) { + this.securitySchemes = providerSpecificationComponents.securitySchemes; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderSpecificationComponents. + * + * @return the new ProviderSpecificationComponents instance + */ + public ProviderSpecificationComponents build() { + return new ProviderSpecificationComponents(this); + } + + /** + * Set the securitySchemes. + * + * @param securitySchemes the securitySchemes + * @return the ProviderSpecificationComponents builder + */ + public Builder securitySchemes(ProviderSpecificationComponentsSecuritySchemes securitySchemes) { + this.securitySchemes = securitySchemes; + return this; + } + } + + protected ProviderSpecificationComponents() {} + + protected ProviderSpecificationComponents(Builder builder) { + securitySchemes = builder.securitySchemes; + } + + /** + * New builder. + * + * @return a ProviderSpecificationComponents builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the securitySchemes. + * + *

The definition of the security scheme for the provider. + * + * @return the securitySchemes + */ + public ProviderSpecificationComponentsSecuritySchemes securitySchemes() { + return securitySchemes; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemes.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemes.java new file mode 100644 index 00000000000..e9e09460808 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemes.java @@ -0,0 +1,163 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The definition of the security scheme for the provider. */ +public class ProviderSpecificationComponentsSecuritySchemes extends GenericModel { + + /** + * The authentication method required for requests made from watsonx Assistant to the + * conversational skill provider. + */ + public interface AuthenticationMethod { + /** basic. */ + String BASIC = "basic"; + /** bearer. */ + String BEARER = "bearer"; + /** api_key. */ + String API_KEY = "api_key"; + /** oauth2. */ + String OAUTH2 = "oauth2"; + /** none. */ + String NONE = "none"; + } + + @SerializedName("authentication_method") + protected String authenticationMethod; + + protected ProviderSpecificationComponentsSecuritySchemesBasic basic; + protected ProviderAuthenticationOAuth2 oauth2; + + /** Builder. */ + public static class Builder { + private String authenticationMethod; + private ProviderSpecificationComponentsSecuritySchemesBasic basic; + private ProviderAuthenticationOAuth2 oauth2; + + /** + * Instantiates a new Builder from an existing ProviderSpecificationComponentsSecuritySchemes + * instance. + * + * @param providerSpecificationComponentsSecuritySchemes the instance to initialize the Builder + * with + */ + private Builder( + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemes) { + this.authenticationMethod = + providerSpecificationComponentsSecuritySchemes.authenticationMethod; + this.basic = providerSpecificationComponentsSecuritySchemes.basic; + this.oauth2 = providerSpecificationComponentsSecuritySchemes.oauth2; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderSpecificationComponentsSecuritySchemes. + * + * @return the new ProviderSpecificationComponentsSecuritySchemes instance + */ + public ProviderSpecificationComponentsSecuritySchemes build() { + return new ProviderSpecificationComponentsSecuritySchemes(this); + } + + /** + * Set the authenticationMethod. + * + * @param authenticationMethod the authenticationMethod + * @return the ProviderSpecificationComponentsSecuritySchemes builder + */ + public Builder authenticationMethod(String authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Set the basic. + * + * @param basic the basic + * @return the ProviderSpecificationComponentsSecuritySchemes builder + */ + public Builder basic(ProviderSpecificationComponentsSecuritySchemesBasic basic) { + this.basic = basic; + return this; + } + + /** + * Set the oauth2. + * + * @param oauth2 the oauth2 + * @return the ProviderSpecificationComponentsSecuritySchemes builder + */ + public Builder oauth2(ProviderAuthenticationOAuth2 oauth2) { + this.oauth2 = oauth2; + return this; + } + } + + protected ProviderSpecificationComponentsSecuritySchemes() {} + + protected ProviderSpecificationComponentsSecuritySchemes(Builder builder) { + authenticationMethod = builder.authenticationMethod; + basic = builder.basic; + oauth2 = builder.oauth2; + } + + /** + * New builder. + * + * @return a ProviderSpecificationComponentsSecuritySchemes builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the authenticationMethod. + * + *

The authentication method required for requests made from watsonx Assistant to the + * conversational skill provider. + * + * @return the authenticationMethod + */ + public String authenticationMethod() { + return authenticationMethod; + } + + /** + * Gets the basic. + * + *

Non-private settings for basic access authentication. + * + * @return the basic + */ + public ProviderSpecificationComponentsSecuritySchemesBasic basic() { + return basic; + } + + /** + * Gets the oauth2. + * + *

Non-private settings for oauth2 authentication. + * + * @return the oauth2 + */ + public ProviderAuthenticationOAuth2 oauth2() { + return oauth2; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesBasic.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesBasic.java new file mode 100644 index 00000000000..91ae68942d8 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesBasic.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Non-private settings for basic access authentication. */ +public class ProviderSpecificationComponentsSecuritySchemesBasic extends GenericModel { + + protected ProviderAuthenticationTypeAndValue username; + + /** Builder. */ + public static class Builder { + private ProviderAuthenticationTypeAndValue username; + + /** + * Instantiates a new Builder from an existing + * ProviderSpecificationComponentsSecuritySchemesBasic instance. + * + * @param providerSpecificationComponentsSecuritySchemesBasic the instance to initialize the + * Builder with + */ + private Builder( + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasic) { + this.username = providerSpecificationComponentsSecuritySchemesBasic.username; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderSpecificationComponentsSecuritySchemesBasic. + * + * @return the new ProviderSpecificationComponentsSecuritySchemesBasic instance + */ + public ProviderSpecificationComponentsSecuritySchemesBasic build() { + return new ProviderSpecificationComponentsSecuritySchemesBasic(this); + } + + /** + * Set the username. + * + * @param username the username + * @return the ProviderSpecificationComponentsSecuritySchemesBasic builder + */ + public Builder username(ProviderAuthenticationTypeAndValue username) { + this.username = username; + return this; + } + } + + protected ProviderSpecificationComponentsSecuritySchemesBasic() {} + + protected ProviderSpecificationComponentsSecuritySchemesBasic(Builder builder) { + username = builder.username; + } + + /** + * New builder. + * + * @return a ProviderSpecificationComponentsSecuritySchemesBasic builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the username. + * + *

The username for basic access authentication. + * + * @return the username + */ + public ProviderAuthenticationTypeAndValue username() { + return username; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationServersItem.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationServersItem.java new file mode 100644 index 00000000000..e8e98126681 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationServersItem.java @@ -0,0 +1,85 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** ProviderSpecificationServersItem. */ +public class ProviderSpecificationServersItem extends GenericModel { + + protected String url; + + /** Builder. */ + public static class Builder { + private String url; + + /** + * Instantiates a new Builder from an existing ProviderSpecificationServersItem instance. + * + * @param providerSpecificationServersItem the instance to initialize the Builder with + */ + private Builder(ProviderSpecificationServersItem providerSpecificationServersItem) { + this.url = providerSpecificationServersItem.url; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a ProviderSpecificationServersItem. + * + * @return the new ProviderSpecificationServersItem instance + */ + public ProviderSpecificationServersItem build() { + return new ProviderSpecificationServersItem(this); + } + + /** + * Set the url. + * + * @param url the url + * @return the ProviderSpecificationServersItem builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + } + + protected ProviderSpecificationServersItem() {} + + protected ProviderSpecificationServersItem(Builder builder) { + url = builder.url; + } + + /** + * New builder. + * + * @return a ProviderSpecificationServersItem builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the url. + * + *

The URL of the conversational skill provider. + * + * @return the url + */ + public String url() { + return url; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java index ab5e8fb6a81..38c3a47b648 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Release.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java index 221fe1d88b3..e9b6d0c371e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseCollection.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java index 00ae2f601a8..fd661543705 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseContent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java index 065408f99ce..7901a0fb2ad 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ReleaseSkill.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java index 9b9f4cfbe98..0cc31f7a05f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RequestAnalytics.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java index c206d2befdc..8200a08ab32 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/ResponseGenericChannel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java index 5e9e93639eb..cd67fed6fea 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntity.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java index 6e1659254c0..ea779fbe194 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityAlternative.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java index c91ddd877f5..7b3c2ad64ea 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityInterpretation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java index e43b6a582ab..315978c8fd0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeEntityRole.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java index d69c9a66d84..70a9bf87a91 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeIntent.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java index a8ccfb4ebd2..a4d74921f52 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGeneric.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2022. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -57,7 +58,6 @@ public class RuntimeResponseGeneric extends GenericModel { "user_defined", RuntimeResponseGenericRuntimeResponseTypeUserDefined.class); discriminatorMapping.put("video", RuntimeResponseGenericRuntimeResponseTypeVideo.class); } - /** The preferred type of control to display. */ public interface Preference { /** dropdown. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java index 0843ea2250a..56bfaee8873 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeAudio.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeAudio. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java index f74a7ee8b86..148895299f4 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeChannelTransfer.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java index ab72ffed7bf..51af855df04 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeConnectToAgent.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java index 375c9d78e5e..74c2386502f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeDate.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeDate. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java index 37ebece03ba..f2833c6a2e1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeIframe.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeIframe. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java index 55b970b6658..0afb76fe2e7 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeImage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeImage. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java index ad971c25dc5..5602a52ed51 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeOption.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeOption. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java index fca3095cf62..979e3f8825e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypePause.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypePause. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java index 59e0a67d12d..a60d12fedf1 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSearch.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeSearch. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java index 91cb8811b1b..c00057637e8 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeSuggestion.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeSuggestion. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java index 22f1ffe92f7..7785b5a164c 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeText.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeText. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java index e5e97cbc0aa..ad4276e0acf 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeUserDefined.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeUserDefined. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java index 22b7e6d2486..55b448e00f9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/RuntimeResponseGenericRuntimeResponseTypeVideo.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; /** RuntimeResponseGenericRuntimeResponseTypeVideo. */ diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java index 0efcbc94dae..1009c164335 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java index 7e311501eb3..434299302d5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultAnswer.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultHighlight.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultHighlight.java index 568eee9f716..5159b13fb6f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultHighlight.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultHighlight.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -20,6 +21,11 @@ /** * An object containing segments of text from search results with query-matching text highlighted * using HTML `<em>` tags. + * + *

This type supports additional properties of type List<String>. An array of strings + * containing segments taken from a field in the search results that is not mapped to the `body`, + * `title`, or `url` property, with query-matching substrings highlighted. The property name is the + * name of the field in the Discovery collection. */ public class SearchResultHighlight extends DynamicModel> { diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java index 24225043d64..065bc768b96 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchResultMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java index 86fbfead8c3..4d0da896dbc 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettings.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -29,11 +30,27 @@ public class SearchSettings extends GenericModel { @SerializedName("schema_mapping") protected SearchSettingsSchemaMapping schemaMapping; + @SerializedName("elastic_search") + protected SearchSettingsElasticSearch elasticSearch; + + @SerializedName("conversational_search") + protected SearchSettingsConversationalSearch conversationalSearch; + + @SerializedName("server_side_search") + protected SearchSettingsServerSideSearch serverSideSearch; + + @SerializedName("client_side_search") + protected SearchSettingsClientSideSearch clientSideSearch; + /** Builder. */ public static class Builder { private SearchSettingsDiscovery discovery; private SearchSettingsMessages messages; private SearchSettingsSchemaMapping schemaMapping; + private SearchSettingsElasticSearch elasticSearch; + private SearchSettingsConversationalSearch conversationalSearch; + private SearchSettingsServerSideSearch serverSideSearch; + private SearchSettingsClientSideSearch clientSideSearch; /** * Instantiates a new Builder from an existing SearchSettings instance. @@ -44,6 +61,10 @@ private Builder(SearchSettings searchSettings) { this.discovery = searchSettings.discovery; this.messages = searchSettings.messages; this.schemaMapping = searchSettings.schemaMapping; + this.elasticSearch = searchSettings.elasticSearch; + this.conversationalSearch = searchSettings.conversationalSearch; + this.serverSideSearch = searchSettings.serverSideSearch; + this.clientSideSearch = searchSettings.clientSideSearch; } /** Instantiates a new builder. */ @@ -106,6 +127,50 @@ public Builder schemaMapping(SearchSettingsSchemaMapping schemaMapping) { this.schemaMapping = schemaMapping; return this; } + + /** + * Set the elasticSearch. + * + * @param elasticSearch the elasticSearch + * @return the SearchSettings builder + */ + public Builder elasticSearch(SearchSettingsElasticSearch elasticSearch) { + this.elasticSearch = elasticSearch; + return this; + } + + /** + * Set the conversationalSearch. + * + * @param conversationalSearch the conversationalSearch + * @return the SearchSettings builder + */ + public Builder conversationalSearch(SearchSettingsConversationalSearch conversationalSearch) { + this.conversationalSearch = conversationalSearch; + return this; + } + + /** + * Set the serverSideSearch. + * + * @param serverSideSearch the serverSideSearch + * @return the SearchSettings builder + */ + public Builder serverSideSearch(SearchSettingsServerSideSearch serverSideSearch) { + this.serverSideSearch = serverSideSearch; + return this; + } + + /** + * Set the clientSideSearch. + * + * @param clientSideSearch the clientSideSearch + * @return the SearchSettings builder + */ + public Builder clientSideSearch(SearchSettingsClientSideSearch clientSideSearch) { + this.clientSideSearch = clientSideSearch; + return this; + } } protected SearchSettings() {} @@ -118,6 +183,10 @@ protected SearchSettings(Builder builder) { discovery = builder.discovery; messages = builder.messages; schemaMapping = builder.schemaMapping; + elasticSearch = builder.elasticSearch; + conversationalSearch = builder.conversationalSearch; + serverSideSearch = builder.serverSideSearch; + clientSideSearch = builder.clientSideSearch; } /** @@ -163,4 +232,51 @@ public SearchSettingsMessages messages() { public SearchSettingsSchemaMapping schemaMapping() { return schemaMapping; } + + /** + * Gets the elasticSearch. + * + *

Configuration settings for the Elasticsearch service used by the search integration. You can + * provide either basic auth or apiKey auth. + * + * @return the elasticSearch + */ + public SearchSettingsElasticSearch elasticSearch() { + return elasticSearch; + } + + /** + * Gets the conversationalSearch. + * + *

Configuration settings for conversational search. + * + * @return the conversationalSearch + */ + public SearchSettingsConversationalSearch conversationalSearch() { + return conversationalSearch; + } + + /** + * Gets the serverSideSearch. + * + *

Configuration settings for the server-side search service used by the search integration. + * You can provide either basic auth, apiKey auth or none. + * + * @return the serverSideSearch + */ + public SearchSettingsServerSideSearch serverSideSearch() { + return serverSideSearch; + } + + /** + * Gets the clientSideSearch. + * + *

Configuration settings for the client-side search service or server-side search service used + * by the search integration. + * + * @return the clientSideSearch + */ + public SearchSettingsClientSideSearch clientSideSearch() { + return clientSideSearch; + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsClientSideSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsClientSideSearch.java new file mode 100644 index 00000000000..04cf2a565b8 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsClientSideSearch.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** + * Configuration settings for the client-side search service or server-side search service used by + * the search integration. + */ +public class SearchSettingsClientSideSearch extends GenericModel { + + protected String filter; + protected Map metadata; + + /** Builder. */ + public static class Builder { + private String filter; + private Map metadata; + + /** + * Instantiates a new Builder from an existing SearchSettingsClientSideSearch instance. + * + * @param searchSettingsClientSideSearch the instance to initialize the Builder with + */ + private Builder(SearchSettingsClientSideSearch searchSettingsClientSideSearch) { + this.filter = searchSettingsClientSideSearch.filter; + this.metadata = searchSettingsClientSideSearch.metadata; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a SearchSettingsClientSideSearch. + * + * @return the new SearchSettingsClientSideSearch instance + */ + public SearchSettingsClientSideSearch build() { + return new SearchSettingsClientSideSearch(this); + } + + /** + * Set the filter. + * + * @param filter the filter + * @return the SearchSettingsClientSideSearch builder + */ + public Builder filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set the metadata. + * + * @param metadata the metadata + * @return the SearchSettingsClientSideSearch builder + */ + public Builder metadata(Map metadata) { + this.metadata = metadata; + return this; + } + } + + protected SearchSettingsClientSideSearch() {} + + protected SearchSettingsClientSideSearch(Builder builder) { + filter = builder.filter; + metadata = builder.metadata; + } + + /** + * New builder. + * + * @return a SearchSettingsClientSideSearch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the filter. + * + *

The filter string that is applied to the search results. + * + * @return the filter + */ + public String filter() { + return filter; + } + + /** + * Gets the metadata. + * + *

The metadata object. + * + * @return the metadata + */ + public Map metadata() { + return metadata; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearch.java new file mode 100644 index 00000000000..77cc98e8a67 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearch.java @@ -0,0 +1,149 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Configuration settings for conversational search. */ +public class SearchSettingsConversationalSearch extends GenericModel { + + protected Boolean enabled; + + @SerializedName("response_length") + protected SearchSettingsConversationalSearchResponseLength responseLength; + + @SerializedName("search_confidence") + protected SearchSettingsConversationalSearchSearchConfidence searchConfidence; + + /** Builder. */ + public static class Builder { + private Boolean enabled; + private SearchSettingsConversationalSearchResponseLength responseLength; + private SearchSettingsConversationalSearchSearchConfidence searchConfidence; + + /** + * Instantiates a new Builder from an existing SearchSettingsConversationalSearch instance. + * + * @param searchSettingsConversationalSearch the instance to initialize the Builder with + */ + private Builder(SearchSettingsConversationalSearch searchSettingsConversationalSearch) { + this.enabled = searchSettingsConversationalSearch.enabled; + this.responseLength = searchSettingsConversationalSearch.responseLength; + this.searchConfidence = searchSettingsConversationalSearch.searchConfidence; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param enabled the enabled + */ + public Builder(Boolean enabled) { + this.enabled = enabled; + } + + /** + * Builds a SearchSettingsConversationalSearch. + * + * @return the new SearchSettingsConversationalSearch instance + */ + public SearchSettingsConversationalSearch build() { + return new SearchSettingsConversationalSearch(this); + } + + /** + * Set the enabled. + * + * @param enabled the enabled + * @return the SearchSettingsConversationalSearch builder + */ + public Builder enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Set the responseLength. + * + * @param responseLength the responseLength + * @return the SearchSettingsConversationalSearch builder + */ + public Builder responseLength(SearchSettingsConversationalSearchResponseLength responseLength) { + this.responseLength = responseLength; + return this; + } + + /** + * Set the searchConfidence. + * + * @param searchConfidence the searchConfidence + * @return the SearchSettingsConversationalSearch builder + */ + public Builder searchConfidence( + SearchSettingsConversationalSearchSearchConfidence searchConfidence) { + this.searchConfidence = searchConfidence; + return this; + } + } + + protected SearchSettingsConversationalSearch() {} + + protected SearchSettingsConversationalSearch(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.enabled, "enabled cannot be null"); + enabled = builder.enabled; + responseLength = builder.responseLength; + searchConfidence = builder.searchConfidence; + } + + /** + * New builder. + * + * @return a SearchSettingsConversationalSearch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the enabled. + * + *

Whether to enable conversational search. + * + * @return the enabled + */ + public Boolean enabled() { + return enabled; + } + + /** + * Gets the responseLength. + * + * @return the responseLength + */ + public SearchSettingsConversationalSearchResponseLength responseLength() { + return responseLength; + } + + /** + * Gets the searchConfidence. + * + * @return the searchConfidence + */ + public SearchSettingsConversationalSearchSearchConfidence searchConfidence() { + return searchConfidence; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchResponseLength.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchResponseLength.java new file mode 100644 index 00000000000..e28aba049d3 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchResponseLength.java @@ -0,0 +1,99 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** SearchSettingsConversationalSearchResponseLength. */ +public class SearchSettingsConversationalSearchResponseLength extends GenericModel { + + /** The response length option. It controls the length of the generated response. */ + public interface Option { + /** concise. */ + String CONCISE = "concise"; + /** moderate. */ + String MODERATE = "moderate"; + /** verbose. */ + String VERBOSE = "verbose"; + } + + protected String option; + + /** Builder. */ + public static class Builder { + private String option; + + /** + * Instantiates a new Builder from an existing SearchSettingsConversationalSearchResponseLength + * instance. + * + * @param searchSettingsConversationalSearchResponseLength the instance to initialize the + * Builder with + */ + private Builder( + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLength) { + this.option = searchSettingsConversationalSearchResponseLength.option; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a SearchSettingsConversationalSearchResponseLength. + * + * @return the new SearchSettingsConversationalSearchResponseLength instance + */ + public SearchSettingsConversationalSearchResponseLength build() { + return new SearchSettingsConversationalSearchResponseLength(this); + } + + /** + * Set the option. + * + * @param option the option + * @return the SearchSettingsConversationalSearchResponseLength builder + */ + public Builder option(String option) { + this.option = option; + return this; + } + } + + protected SearchSettingsConversationalSearchResponseLength() {} + + protected SearchSettingsConversationalSearchResponseLength(Builder builder) { + option = builder.option; + } + + /** + * New builder. + * + * @return a SearchSettingsConversationalSearchResponseLength builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the option. + * + *

The response length option. It controls the length of the generated response. + * + * @return the option + */ + public String option() { + return option; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchSearchConfidence.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchSearchConfidence.java new file mode 100644 index 00000000000..09c5f6139ee --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchSearchConfidence.java @@ -0,0 +1,105 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** SearchSettingsConversationalSearchSearchConfidence. */ +public class SearchSettingsConversationalSearchSearchConfidence extends GenericModel { + + /** + * The search confidence threshold. It controls the tendency for conversational search to produce + * “I don't know” answers. + */ + public interface Threshold { + /** rarely. */ + String RARELY = "rarely"; + /** less_often. */ + String LESS_OFTEN = "less_often"; + /** more_often. */ + String MORE_OFTEN = "more_often"; + /** most_often. */ + String MOST_OFTEN = "most_often"; + } + + protected String threshold; + + /** Builder. */ + public static class Builder { + private String threshold; + + /** + * Instantiates a new Builder from an existing + * SearchSettingsConversationalSearchSearchConfidence instance. + * + * @param searchSettingsConversationalSearchSearchConfidence the instance to initialize the + * Builder with + */ + private Builder( + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidence) { + this.threshold = searchSettingsConversationalSearchSearchConfidence.threshold; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a SearchSettingsConversationalSearchSearchConfidence. + * + * @return the new SearchSettingsConversationalSearchSearchConfidence instance + */ + public SearchSettingsConversationalSearchSearchConfidence build() { + return new SearchSettingsConversationalSearchSearchConfidence(this); + } + + /** + * Set the threshold. + * + * @param threshold the threshold + * @return the SearchSettingsConversationalSearchSearchConfidence builder + */ + public Builder threshold(String threshold) { + this.threshold = threshold; + return this; + } + } + + protected SearchSettingsConversationalSearchSearchConfidence() {} + + protected SearchSettingsConversationalSearchSearchConfidence(Builder builder) { + threshold = builder.threshold; + } + + /** + * New builder. + * + * @return a SearchSettingsConversationalSearchSearchConfidence builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the threshold. + * + *

The search confidence threshold. It controls the tendency for conversational search to + * produce “I don't know” answers. + * + * @return the threshold + */ + public String threshold() { + return threshold; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java index 4a76f2fddd4..0aa11cdbde0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscovery.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java index f1de10d32bd..0c7b498b395 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsDiscoveryAuthentication.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsElasticSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsElasticSearch.java new file mode 100644 index 00000000000..162f662aee8 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsElasticSearch.java @@ -0,0 +1,344 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Configuration settings for the Elasticsearch service used by the search integration. You can + * provide either basic auth or apiKey auth. + */ +public class SearchSettingsElasticSearch extends GenericModel { + + protected String url; + protected String port; + protected String username; + protected String password; + protected String index; + protected List filter; + + @SerializedName("query_body") + protected Map queryBody; + + @SerializedName("managed_index") + protected String managedIndex; + + protected String apikey; + + /** Builder. */ + public static class Builder { + private String url; + private String port; + private String username; + private String password; + private String index; + private List filter; + private Map queryBody; + private String managedIndex; + private String apikey; + + /** + * Instantiates a new Builder from an existing SearchSettingsElasticSearch instance. + * + * @param searchSettingsElasticSearch the instance to initialize the Builder with + */ + private Builder(SearchSettingsElasticSearch searchSettingsElasticSearch) { + this.url = searchSettingsElasticSearch.url; + this.port = searchSettingsElasticSearch.port; + this.username = searchSettingsElasticSearch.username; + this.password = searchSettingsElasticSearch.password; + this.index = searchSettingsElasticSearch.index; + this.filter = searchSettingsElasticSearch.filter; + this.queryBody = searchSettingsElasticSearch.queryBody; + this.managedIndex = searchSettingsElasticSearch.managedIndex; + this.apikey = searchSettingsElasticSearch.apikey; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param url the url + * @param port the port + * @param index the index + */ + public Builder(String url, String port, String index) { + this.url = url; + this.port = port; + this.index = index; + } + + /** + * Builds a SearchSettingsElasticSearch. + * + * @return the new SearchSettingsElasticSearch instance + */ + public SearchSettingsElasticSearch build() { + return new SearchSettingsElasticSearch(this); + } + + /** + * Adds a new element to filter. + * + * @param filter the new element to be added + * @return the SearchSettingsElasticSearch builder + */ + public Builder addFilter(Object filter) { + com.ibm.cloud.sdk.core.util.Validator.notNull(filter, "filter cannot be null"); + if (this.filter == null) { + this.filter = new ArrayList(); + } + this.filter.add(filter); + return this; + } + + /** + * Set the url. + * + * @param url the url + * @return the SearchSettingsElasticSearch builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * Set the port. + * + * @param port the port + * @return the SearchSettingsElasticSearch builder + */ + public Builder port(String port) { + this.port = port; + return this; + } + + /** + * Set the username. + * + * @param username the username + * @return the SearchSettingsElasticSearch builder + */ + public Builder username(String username) { + this.username = username; + return this; + } + + /** + * Set the password. + * + * @param password the password + * @return the SearchSettingsElasticSearch builder + */ + public Builder password(String password) { + this.password = password; + return this; + } + + /** + * Set the index. + * + * @param index the index + * @return the SearchSettingsElasticSearch builder + */ + public Builder index(String index) { + this.index = index; + return this; + } + + /** + * Set the filter. Existing filter will be replaced. + * + * @param filter the filter + * @return the SearchSettingsElasticSearch builder + */ + public Builder filter(List filter) { + this.filter = filter; + return this; + } + + /** + * Set the queryBody. + * + * @param queryBody the queryBody + * @return the SearchSettingsElasticSearch builder + */ + public Builder queryBody(Map queryBody) { + this.queryBody = queryBody; + return this; + } + + /** + * Set the managedIndex. + * + * @param managedIndex the managedIndex + * @return the SearchSettingsElasticSearch builder + */ + public Builder managedIndex(String managedIndex) { + this.managedIndex = managedIndex; + return this; + } + + /** + * Set the apikey. + * + * @param apikey the apikey + * @return the SearchSettingsElasticSearch builder + */ + public Builder apikey(String apikey) { + this.apikey = apikey; + return this; + } + } + + protected SearchSettingsElasticSearch() {} + + protected SearchSettingsElasticSearch(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.url, "url cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.port, "port cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.index, "index cannot be null"); + url = builder.url; + port = builder.port; + username = builder.username; + password = builder.password; + index = builder.index; + filter = builder.filter; + queryBody = builder.queryBody; + managedIndex = builder.managedIndex; + apikey = builder.apikey; + } + + /** + * New builder. + * + * @return a SearchSettingsElasticSearch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the url. + * + *

The URL for the Elasticsearch service. + * + * @return the url + */ + public String url() { + return url; + } + + /** + * Gets the port. + * + *

The port number for the Elasticsearch service URL. + * + *

**Note:** It can be omitted if a port number is appended to the URL. + * + * @return the port + */ + public String port() { + return port; + } + + /** + * Gets the username. + * + *

The username of the basic authentication method. + * + * @return the username + */ + public String username() { + return username; + } + + /** + * Gets the password. + * + *

The password of the basic authentication method. The credentials are not returned due to + * security reasons. + * + * @return the password + */ + public String password() { + return password; + } + + /** + * Gets the index. + * + *

The Elasticsearch index to use for the search integration. + * + * @return the index + */ + public String index() { + return index; + } + + /** + * Gets the filter. + * + *

An array of filters that can be applied to the search results via the `$FILTER` variable in + * the `query_body`.For more information, see [Elasticsearch filter + * documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/filter-search-results.html). + * + * @return the filter + */ + public List filter() { + return filter; + } + + /** + * Gets the queryBody. + * + *

The Elasticsearch query object. For more information, see [Elasticsearch search API + * documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html). + * + * @return the queryBody + */ + public Map queryBody() { + return queryBody; + } + + /** + * Gets the managedIndex. + * + *

The Elasticsearch index for uploading documents. It is created automatically when the upload + * document option is selected from the user interface. + * + * @return the managedIndex + */ + public String managedIndex() { + return managedIndex; + } + + /** + * Gets the apikey. + * + *

The API key of the apiKey authentication method. Use either basic auth or apiKey auth. The + * credentials are not returned due to security reasons. + * + * @return the apikey + */ + public String apikey() { + return apikey; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java index 00f8b83c230..6b85b69aa9b 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsMessages.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java index 7a78437bb47..27b1d47814f 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsSchemaMapping.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsServerSideSearch.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsServerSideSearch.java new file mode 100644 index 00000000000..4f91a3dd09a --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSettingsServerSideSearch.java @@ -0,0 +1,324 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** + * Configuration settings for the server-side search service used by the search integration. You can + * provide either basic auth, apiKey auth or none. + */ +public class SearchSettingsServerSideSearch extends GenericModel { + + /** The authorization type that is used. */ + public interface AuthType { + /** basic. */ + String BASIC = "basic"; + /** apikey. */ + String APIKEY = "apikey"; + /** none. */ + String NONE = "none"; + } + + protected String url; + protected String port; + protected String username; + protected String password; + protected String filter; + protected Map metadata; + protected String apikey; + + @SerializedName("no_auth") + protected Boolean noAuth; + + @SerializedName("auth_type") + protected String authType; + + /** Builder. */ + public static class Builder { + private String url; + private String port; + private String username; + private String password; + private String filter; + private Map metadata; + private String apikey; + private Boolean noAuth; + private String authType; + + /** + * Instantiates a new Builder from an existing SearchSettingsServerSideSearch instance. + * + * @param searchSettingsServerSideSearch the instance to initialize the Builder with + */ + private Builder(SearchSettingsServerSideSearch searchSettingsServerSideSearch) { + this.url = searchSettingsServerSideSearch.url; + this.port = searchSettingsServerSideSearch.port; + this.username = searchSettingsServerSideSearch.username; + this.password = searchSettingsServerSideSearch.password; + this.filter = searchSettingsServerSideSearch.filter; + this.metadata = searchSettingsServerSideSearch.metadata; + this.apikey = searchSettingsServerSideSearch.apikey; + this.noAuth = searchSettingsServerSideSearch.noAuth; + this.authType = searchSettingsServerSideSearch.authType; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param url the url + */ + public Builder(String url) { + this.url = url; + } + + /** + * Builds a SearchSettingsServerSideSearch. + * + * @return the new SearchSettingsServerSideSearch instance + */ + public SearchSettingsServerSideSearch build() { + return new SearchSettingsServerSideSearch(this); + } + + /** + * Set the url. + * + * @param url the url + * @return the SearchSettingsServerSideSearch builder + */ + public Builder url(String url) { + this.url = url; + return this; + } + + /** + * Set the port. + * + * @param port the port + * @return the SearchSettingsServerSideSearch builder + */ + public Builder port(String port) { + this.port = port; + return this; + } + + /** + * Set the username. + * + * @param username the username + * @return the SearchSettingsServerSideSearch builder + */ + public Builder username(String username) { + this.username = username; + return this; + } + + /** + * Set the password. + * + * @param password the password + * @return the SearchSettingsServerSideSearch builder + */ + public Builder password(String password) { + this.password = password; + return this; + } + + /** + * Set the filter. + * + * @param filter the filter + * @return the SearchSettingsServerSideSearch builder + */ + public Builder filter(String filter) { + this.filter = filter; + return this; + } + + /** + * Set the metadata. + * + * @param metadata the metadata + * @return the SearchSettingsServerSideSearch builder + */ + public Builder metadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set the apikey. + * + * @param apikey the apikey + * @return the SearchSettingsServerSideSearch builder + */ + public Builder apikey(String apikey) { + this.apikey = apikey; + return this; + } + + /** + * Set the noAuth. + * + * @param noAuth the noAuth + * @return the SearchSettingsServerSideSearch builder + */ + public Builder noAuth(Boolean noAuth) { + this.noAuth = noAuth; + return this; + } + + /** + * Set the authType. + * + * @param authType the authType + * @return the SearchSettingsServerSideSearch builder + */ + public Builder authType(String authType) { + this.authType = authType; + return this; + } + } + + protected SearchSettingsServerSideSearch() {} + + protected SearchSettingsServerSideSearch(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.url, "url cannot be null"); + url = builder.url; + port = builder.port; + username = builder.username; + password = builder.password; + filter = builder.filter; + metadata = builder.metadata; + apikey = builder.apikey; + noAuth = builder.noAuth; + authType = builder.authType; + } + + /** + * New builder. + * + * @return a SearchSettingsServerSideSearch builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the url. + * + *

The URL of the server-side search service. + * + * @return the url + */ + public String url() { + return url; + } + + /** + * Gets the port. + * + *

The port number of the server-side search service. + * + * @return the port + */ + public String port() { + return port; + } + + /** + * Gets the username. + * + *

The username of the basic authentication method. + * + * @return the username + */ + public String username() { + return username; + } + + /** + * Gets the password. + * + *

The password of the basic authentication method. The credentials are not returned due to + * security reasons. + * + * @return the password + */ + public String password() { + return password; + } + + /** + * Gets the filter. + * + *

The filter string that is applied to the search results. + * + * @return the filter + */ + public String filter() { + return filter; + } + + /** + * Gets the metadata. + * + *

The metadata object. + * + * @return the metadata + */ + public Map metadata() { + return metadata; + } + + /** + * Gets the apikey. + * + *

The API key of the apiKey authentication method. The credentails are not returned due to + * security reasons. + * + * @return the apikey + */ + public String apikey() { + return apikey; + } + + /** + * Gets the noAuth. + * + *

To clear previous auth, specify `no_auth = true`. + * + * @return the noAuth + */ + public Boolean noAuth() { + return noAuth; + } + + /** + * Gets the authType. + * + *

The authorization type that is used. + * + * @return the authType + */ + public String authType() { + return authType; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java index 8f01d72f236..b569c9bdce3 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SearchSkillWarning.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java index a30588076a5..63817af86f5 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SessionResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java index 8e11214b93d..b3c5ae2daef 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/Skill.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java index 543bbc3d6e3..67f4332635a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillImport.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java index 900ef99b8cc..a1c8e515340 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsAsyncRequestStatus.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java index 5f0c59d204c..45c0b1c310e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/SkillsExport.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatefulMessageResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatefulMessageResponse.java index 2216d78bb65..0511730897a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatefulMessageResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatefulMessageResponse.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponse.java new file mode 100644 index 00000000000..9ff9afeef07 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponse.java @@ -0,0 +1,73 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** Message final response content. */ +public class StatelessFinalResponse extends GenericModel { + + protected StatelessFinalResponseOutput output; + protected StatelessMessageContext context; + + @SerializedName("user_id") + protected String userId; + + protected StatelessFinalResponse() {} + + /** + * Gets the output. + * + *

Assistant output to be rendered or processed by the client. + * + * @return the output + */ + public StatelessFinalResponseOutput getOutput() { + return output; + } + + /** + * Gets the context. + * + *

Context data for the conversation. You can use this property to access context variables. + * The context is stored by the assistant on a per-session basis. + * + *

**Note:** The context is included in message responses only if **return_context**=`true` in + * the message request. Full context is always included in logs. + * + * @return the context + */ + public StatelessMessageContext getContext() { + return context; + } + + /** + * Gets the userId. + * + *

A string value that identifies the user who is interacting with the assistant. The client + * must provide a unique identifier for each individual end user who accesses the application. For + * user-based plans, this user ID is used to identify unique users for billing purposes. This + * string cannot contain carriage return, newline, or tab characters. If no value is specified in + * the input, **user_id** is automatically set to the value of **context.global.session_id**. + * + *

**Note:** This property is the same as the **user_id** property in the global system + * context. + * + * @return the userId + */ + public String getUserId() { + return userId; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseOutput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseOutput.java new file mode 100644 index 00000000000..075d8de9b8b --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseOutput.java @@ -0,0 +1,127 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.List; +import java.util.Map; + +/** Assistant output to be rendered or processed by the client. */ +public class StatelessFinalResponseOutput extends GenericModel { + + protected List generic; + protected List intents; + protected List entities; + protected List actions; + protected MessageOutputDebug debug; + + @SerializedName("user_defined") + protected Map userDefined; + + protected MessageOutputSpelling spelling; + + @SerializedName("streaming_metadata") + protected StatelessMessageContext streamingMetadata; + + protected StatelessFinalResponseOutput() {} + + /** + * Gets the generic. + * + *

Output intended for any channel. It is the responsibility of the client application to + * implement the supported response types. + * + * @return the generic + */ + public List getGeneric() { + return generic; + } + + /** + * Gets the intents. + * + *

An array of intents recognized in the user input, sorted in descending order of confidence. + * + * @return the intents + */ + public List getIntents() { + return intents; + } + + /** + * Gets the entities. + * + *

An array of entities identified in the user input. + * + * @return the entities + */ + public List getEntities() { + return entities; + } + + /** + * Gets the actions. + * + *

An array of objects describing any actions requested by the dialog node. + * + * @return the actions + */ + public List getActions() { + return actions; + } + + /** + * Gets the debug. + * + *

Additional detailed information about a message response and how it was generated. + * + * @return the debug + */ + public MessageOutputDebug getDebug() { + return debug; + } + + /** + * Gets the userDefined. + * + *

An object containing any custom properties included in the response. This object includes + * any arbitrary properties defined in the dialog JSON editor as part of the dialog node output. + * + * @return the userDefined + */ + public Map getUserDefined() { + return userDefined; + } + + /** + * Gets the spelling. + * + *

Properties describing any spelling corrections in the user input that was received. + * + * @return the spelling + */ + public MessageOutputSpelling getSpelling() { + return spelling; + } + + /** + * Gets the streamingMetadata. + * + * @return the streamingMetadata + */ + public StatelessMessageContext getStreamingMetadata() { + return streamingMetadata; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContext.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContext.java index 7fed7ae9908..b0970694307 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContext.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContext.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextGlobal.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextGlobal.java index 80f2a41437b..00631826f13 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextGlobal.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextGlobal.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkills.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkills.java index 48ea9f6d893..6f2495d6977 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkills.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkills.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkillsActionsSkill.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkillsActionsSkill.java index f81d6c7ca37..c551297d575 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkillsActionsSkill.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageContextSkillsActionsSkill.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInput.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInput.java index 3b4469784c9..ea2995aeb33 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInput.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInput.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInputOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInputOptions.java index 066dabb74e2..f04c014cccb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInputOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageInputOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageResponse.java index 3be46bf97ff..c4a45493ac0 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageResponse.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageResponse.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageStreamResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageStreamResponse.java new file mode 100644 index 00000000000..67b52cd8601 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatelessMessageStreamResponse.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A stateless streamed response form the watsonx Assistant service. + * + *

Classes which extend this class: - StatelessMessageStreamResponseMessageStreamPartialItem - + * StatelessMessageStreamResponseMessageStreamCompleteItem - + * StatelessMessageStreamResponseStatelessMessageStreamFinalResponse + */ +public class StatelessMessageStreamResponse extends GenericModel { + + @SerializedName("partial_item") + protected PartialItem partialItem; + + @SerializedName("complete_item") + protected CompleteItem completeItem; + + @SerializedName("final_response") + protected StatelessFinalResponse finalResponse; + + protected StatelessMessageStreamResponse() {} + + /** + * Gets the partialItem. + * + *

Message response partial item content. + * + * @return the partialItem + */ + public PartialItem getPartialItem() { + return partialItem; + } + + /** + * Gets the completeItem. + * + * @return the completeItem + */ + public CompleteItem getCompleteItem() { + return completeItem; + } + + /** + * Gets the finalResponse. + * + *

Message final response content. + * + * @return the finalResponse + */ + public StatelessFinalResponse getFinalResponse() { + return finalResponse; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java index 3017e55e98d..a203cc6c46e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/StatusError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java index 0aa9252ca4d..166b72776e9 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventActionSource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java index 95f56638618..287ab6d477a 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCallout.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; @@ -34,6 +35,9 @@ public interface Type { @SerializedName("result_variable") protected String resultVariable; + protected TurnEventCalloutCalloutRequest request; + protected TurnEventCalloutCalloutResponse response; + protected TurnEventCalloutCallout() {} /** @@ -69,4 +73,26 @@ public Map getInternal() { public String getResultVariable() { return resultVariable; } + + /** + * Gets the request. + * + *

The request object executed to the external server specified by the extension. + * + * @return the request + */ + public TurnEventCalloutCalloutRequest getRequest() { + return request; + } + + /** + * Gets the response. + * + *

The response object received by the external server made by the extension. + * + * @return the response + */ + public TurnEventCalloutCalloutResponse getResponse() { + return response; + } } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutRequest.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutRequest.java new file mode 100644 index 00000000000..cdc9d43d5df --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutRequest.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** TurnEventCalloutCalloutRequest. */ +public class TurnEventCalloutCalloutRequest extends GenericModel { + + /** The REST method of the request. */ + public interface Method { + /** get. */ + String GET = "get"; + /** post. */ + String POST = "post"; + /** put. */ + String PUT = "put"; + /** delete. */ + String DELETE = "delete"; + /** patch. */ + String PATCH = "patch"; + } + + protected String method; + protected String url; + protected String path; + + @SerializedName("query_parameters") + protected String queryParameters; + + protected Map headers; + protected Map body; + + protected TurnEventCalloutCalloutRequest() {} + + /** + * Gets the method. + * + *

The REST method of the request. + * + * @return the method + */ + public String getMethod() { + return method; + } + + /** + * Gets the url. + * + *

The host URL of the request call. + * + * @return the url + */ + public String getUrl() { + return url; + } + + /** + * Gets the path. + * + *

The URL path of the request call. + * + * @return the path + */ + public String getPath() { + return path; + } + + /** + * Gets the queryParameters. + * + *

Any query parameters appended to the URL of the request call. + * + * @return the queryParameters + */ + public String getQueryParameters() { + return queryParameters; + } + + /** + * Gets the headers. + * + *

Any headers included in the request call. + * + * @return the headers + */ + public Map getHeaders() { + return headers; + } + + /** + * Gets the body. + * + *

Contains the response of the external server or an object. In cases like timeouts or + * connections errors, it will contain details of why the callout to the external server failed. + * + * @return the body + */ + public Map getBody() { + return body; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutResponse.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutResponse.java new file mode 100644 index 00000000000..ae2a2ebecb9 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutResponse.java @@ -0,0 +1,66 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Map; + +/** TurnEventCalloutCalloutResponse. */ +public class TurnEventCalloutCalloutResponse extends GenericModel { + + protected String body; + + @SerializedName("status_code") + protected Long statusCode; + + @SerializedName("last_event") + protected Map lastEvent; + + protected TurnEventCalloutCalloutResponse() {} + + /** + * Gets the body. + * + *

The final response string. This response is a composition of every partial chunk received + * from the stream. + * + * @return the body + */ + public String getBody() { + return body; + } + + /** + * Gets the statusCode. + * + *

The final status code of the response. + * + * @return the statusCode + */ + public Long getStatusCode() { + return statusCode; + } + + /** + * Gets the lastEvent. + * + *

The response from the last chunk received from the response stream. + * + * @return the lastEvent + */ + public Map getLastEvent() { + return lastEvent; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java index 5b794e7300d..675d9a3be08 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java index 21ba926840e..1bbb39ea9c6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventNodeSource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java index ed01b57391f..a32726575fb 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/TurnEventSearchError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java index 2fcaa69c08f..d510469298e 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -23,7 +24,7 @@ public class UpdateEnvironmentOptions extends GenericModel { protected String environmentId; protected String name; protected String description; - protected BaseEnvironmentOrchestration orchestration; + protected UpdateEnvironmentOrchestration orchestration; protected Long sessionTimeout; protected List skillReferences; @@ -33,7 +34,7 @@ public static class Builder { private String environmentId; private String name; private String description; - private BaseEnvironmentOrchestration orchestration; + private UpdateEnvironmentOrchestration orchestration; private Long sessionTimeout; private List skillReferences; @@ -141,7 +142,7 @@ public Builder description(String description) { * @param orchestration the orchestration * @return the UpdateEnvironmentOptions builder */ - public Builder orchestration(BaseEnvironmentOrchestration orchestration) { + public Builder orchestration(UpdateEnvironmentOrchestration orchestration) { this.orchestration = orchestration; return this; } @@ -257,7 +258,7 @@ public String description() { * * @return the orchestration */ - public BaseEnvironmentOrchestration orchestration() { + public UpdateEnvironmentOrchestration orchestration() { return orchestration; } diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOrchestration.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOrchestration.java new file mode 100644 index 00000000000..bee979e0a47 --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOrchestration.java @@ -0,0 +1,89 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The search skill orchestration settings for the environment. */ +public class UpdateEnvironmentOrchestration extends GenericModel { + + @SerializedName("search_skill_fallback") + protected Boolean searchSkillFallback; + + /** Builder. */ + public static class Builder { + private Boolean searchSkillFallback; + + /** + * Instantiates a new Builder from an existing UpdateEnvironmentOrchestration instance. + * + * @param updateEnvironmentOrchestration the instance to initialize the Builder with + */ + private Builder(UpdateEnvironmentOrchestration updateEnvironmentOrchestration) { + this.searchSkillFallback = updateEnvironmentOrchestration.searchSkillFallback; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Builds a UpdateEnvironmentOrchestration. + * + * @return the new UpdateEnvironmentOrchestration instance + */ + public UpdateEnvironmentOrchestration build() { + return new UpdateEnvironmentOrchestration(this); + } + + /** + * Set the searchSkillFallback. + * + * @param searchSkillFallback the searchSkillFallback + * @return the UpdateEnvironmentOrchestration builder + */ + public Builder searchSkillFallback(Boolean searchSkillFallback) { + this.searchSkillFallback = searchSkillFallback; + return this; + } + } + + protected UpdateEnvironmentOrchestration() {} + + protected UpdateEnvironmentOrchestration(Builder builder) { + searchSkillFallback = builder.searchSkillFallback; + } + + /** + * New builder. + * + * @return a UpdateEnvironmentOrchestration builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the searchSkillFallback. + * + *

Whether to fall back to a search skill when responding to messages that do not match any + * intent or action defined in dialog or action skills. (If no search skill is configured for the + * environment, this property is ignored.). + * + * @return the searchSkillFallback + */ + public Boolean searchSkillFallback() { + return searchSkillFallback; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateProviderOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateProviderOptions.java new file mode 100644 index 00000000000..23b9c42494f --- /dev/null +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateProviderOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The updateProvider options. */ +public class UpdateProviderOptions extends GenericModel { + + protected String providerId; + protected ProviderSpecification specification; + protected ProviderPrivate xPrivate; + + /** Builder. */ + public static class Builder { + private String providerId; + private ProviderSpecification specification; + private ProviderPrivate xPrivate; + + /** + * Instantiates a new Builder from an existing UpdateProviderOptions instance. + * + * @param updateProviderOptions the instance to initialize the Builder with + */ + private Builder(UpdateProviderOptions updateProviderOptions) { + this.providerId = updateProviderOptions.providerId; + this.specification = updateProviderOptions.specification; + this.xPrivate = updateProviderOptions.xPrivate; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param providerId the providerId + * @param specification the specification + * @param xPrivate the xPrivate + */ + public Builder( + String providerId, ProviderSpecification specification, ProviderPrivate xPrivate) { + this.providerId = providerId; + this.specification = specification; + this.xPrivate = xPrivate; + } + + /** + * Builds a UpdateProviderOptions. + * + * @return the new UpdateProviderOptions instance + */ + public UpdateProviderOptions build() { + return new UpdateProviderOptions(this); + } + + /** + * Set the providerId. + * + * @param providerId the providerId + * @return the UpdateProviderOptions builder + */ + public Builder providerId(String providerId) { + this.providerId = providerId; + return this; + } + + /** + * Set the specification. + * + * @param specification the specification + * @return the UpdateProviderOptions builder + */ + public Builder specification(ProviderSpecification specification) { + this.specification = specification; + return this; + } + + /** + * Set the xPrivate. + * + * @param xPrivate the xPrivate + * @return the UpdateProviderOptions builder + */ + public Builder xPrivate(ProviderPrivate xPrivate) { + this.xPrivate = xPrivate; + return this; + } + } + + protected UpdateProviderOptions() {} + + protected UpdateProviderOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.providerId, "providerId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notNull( + builder.specification, "specification cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.notNull(builder.xPrivate, "xPrivate cannot be null"); + providerId = builder.providerId; + specification = builder.specification; + xPrivate = builder.xPrivate; + } + + /** + * New builder. + * + * @return a UpdateProviderOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the providerId. + * + *

Unique identifier of the conversational skill provider. + * + * @return the providerId + */ + public String providerId() { + return providerId; + } + + /** + * Gets the specification. + * + *

The specification of the provider. + * + * @return the specification + */ + public ProviderSpecification specification() { + return specification; + } + + /** + * Gets the xPrivate. + * + *

Private information of the provider. + * + * @return the xPrivate + */ + public ProviderPrivate xPrivate() { + return xPrivate; + } +} diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java index 1ef9f7ed203..d4e011938b6 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/assistant/src/main/java/com/ibm/watson/assistant/v2/package-info.java b/assistant/src/main/java/com/ibm/watson/assistant/v2/package-info.java index 6b85dcb3fdd..9e101146c21 100644 --- a/assistant/src/main/java/com/ibm/watson/assistant/v2/package-info.java +++ b/assistant/src/main/java/com/ibm/watson/assistant/v2/package-info.java @@ -10,5 +10,6 @@ * 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. */ + /** watsonx Assistant v2 v2. */ package com.ibm.watson.assistant.v2; diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantTest.java index 543a16333f5..19dc8438dc4 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v1/AssistantTest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1; import static org.testng.Assert.*; diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v1/utils/TestUtilities.java b/assistant/src/test/java/com/ibm/watson/assistant/v1/utils/TestUtilities.java index 94cf7454f67..d6fbde1a6b4 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v1/utils/TestUtilities.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v1/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v1.utils; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -18,6 +19,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; +import java.util.Base64; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -114,8 +116,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception { diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java index 21cadae38ec..6984d962f9b 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantServiceIT.java @@ -14,13 +14,20 @@ import static org.junit.Assert.*; -import com.ibm.cloud.sdk.core.security.*; import com.ibm.watson.assistant.v2.model.*; import com.ibm.watson.assistant.v2.model.ListLogsOptions.Builder; import com.ibm.watson.common.RetryRunner; +import com.launchdarkly.eventsource.StreamException; +import java.io.*; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import okhttp3.OkHttpClient; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -32,6 +39,8 @@ public class AssistantServiceIT extends AssistantServiceTest { private Assistant service; private String assistantId; + private static final String RESOURCE = "src/test/resources/assistant/"; + /** * Sets up the tests. * @@ -284,6 +293,98 @@ public void testGettingReleases() { assertEquals("Available", release.status()); } + /** Test Provider API */ + @Test + public void testProviders() { + ListProvidersOptions listProviderOptions = new ListProvidersOptions.Builder().build(); + ProviderCollection listProvidersResponse = service.listProviders(listProviderOptions).execute().getResult(); + String providerId = listProvidersResponse.getConversationalSkillProviders().get(0).getProviderId(); + assertNotNull(listProvidersResponse); + assertNotNull(providerId); + + ArrayList serverList = new ArrayList<>(); + serverList.add( + new ProviderSpecificationServersItem.Builder() + .url("https://myProCodeProvider.com") + .build()); + + ProviderSpecification providerSpecification = + new ProviderSpecification.Builder().servers(serverList).build(); + + ProviderAuthenticationTypeAndValue password = new ProviderAuthenticationTypeAndValue.Builder().type("value").value("test").build(); + ProviderPrivateAuthenticationBasicFlow basicFlow = new ProviderPrivateAuthenticationBasicFlow.Builder().password(password).build(); + ProviderPrivate providerPrivate = new ProviderPrivate.Builder().authentication(basicFlow).build(); + + // service.setServiceUrl("http://localhost:9001"); + + UpdateProviderOptions updateProvidersOptions = + new UpdateProviderOptions.Builder() + .providerId(providerId) + .specification(providerSpecification) + .xPrivate(providerPrivate) + .build(); + ProviderResponse updateProvidersResponse = + service.updateProvider(updateProvidersOptions).execute().getResult(); + assertNotNull(updateProvidersResponse); + } + + /** Test Import/Export Release API */ + @Test + public void testImportRelease() throws IOException { + InputStream testFile = new FileInputStream(RESOURCE + "demo_wa_V4.zip"); + CreateReleaseImportOptions importOptions = + new CreateReleaseImportOptions.Builder().assistantId(assistantId).body(testFile).build(); + CreateAssistantReleaseImportResponse importResponse = service.createReleaseImport(importOptions).execute().getResult(); + assertNotNull(importResponse); + } + + @Test + public void testDownloadExportRelease() throws IOException { + DownloadReleaseExportOptions exportOptions = + new DownloadReleaseExportOptions.Builder().assistantId(assistantId).release("1").build(); + CreateReleaseExportWithStatusErrors exportResponse = service.downloadReleaseExport(exportOptions).execute().getResult(); + assertNotNull(exportResponse); + } + + @Test + public void testDownloadExportReleaseStream() throws IOException { + DownloadReleaseExportOptions exportOptions = + new DownloadReleaseExportOptions.Builder().assistantId(assistantId).release("1").build(); + InputStream exportReleaseStream = + service.downloadReleaseExportAsStream(exportOptions).execute().getResult(); + assertNotNull(exportReleaseStream); + } + + @Test + public void testMessageStreamStateless() throws IOException, StreamException { + MessageInput messageInput = + new MessageInput.Builder() + .messageType("text") + .text("can you list the steps to create a custom extension?") + .build(); + MessageStreamStatelessOptions messageStreamStatelessOptions = + new MessageStreamStatelessOptions.Builder() + .assistantId("99a74576-47de-42a9-ab05-9dd98978809b") + .environmentId("03dce212-1aa3-436a-a747-8717a96ded5a") + .userId("Angelo") + .input(messageInput) + .build(); + InputStream inputStream = + service.messageStreamStateless(messageStreamStatelessOptions).execute().getResult(); + + MessageEventDeserializer messageDeserializer = new MessageEventDeserializer.Builder(inputStream).build(); + for (StatelessMessageStreamResponse message : messageDeserializer.statelessMessages()) { + if (message.getPartialItem() != null) { + assertNotNull(message.getPartialItem().getText()); + } else if (message.getCompleteItem() != null) { + assertNotNull(message.getCompleteItem().text()); + } else if (message.getFinalResponse() != null) { + assertNotNull(message.getFinalResponse().getOutput()); + assertNotNull(message.getFinalResponse().getOutput()); + } + } + } + /** Test Deploy Releases. */ // @Test public void testDeployRelease() { diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java index 643a12bf862..967107c000a 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/AssistantTest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2; import static org.testng.Assert.*; @@ -21,12 +22,16 @@ import com.ibm.watson.assistant.v2.model.AssistantCollection; import com.ibm.watson.assistant.v2.model.AssistantData; import com.ibm.watson.assistant.v2.model.AssistantState; -import com.ibm.watson.assistant.v2.model.BaseEnvironmentOrchestration; import com.ibm.watson.assistant.v2.model.BulkClassifyOptions; import com.ibm.watson.assistant.v2.model.BulkClassifyResponse; import com.ibm.watson.assistant.v2.model.BulkClassifyUtterance; import com.ibm.watson.assistant.v2.model.CaptureGroup; import com.ibm.watson.assistant.v2.model.CreateAssistantOptions; +import com.ibm.watson.assistant.v2.model.CreateAssistantReleaseImportResponse; +import com.ibm.watson.assistant.v2.model.CreateProviderOptions; +import com.ibm.watson.assistant.v2.model.CreateReleaseExportOptions; +import com.ibm.watson.assistant.v2.model.CreateReleaseExportWithStatusErrors; +import com.ibm.watson.assistant.v2.model.CreateReleaseImportOptions; import com.ibm.watson.assistant.v2.model.CreateReleaseOptions; import com.ibm.watson.assistant.v2.model.CreateSessionOptions; import com.ibm.watson.assistant.v2.model.DeleteAssistantOptions; @@ -34,11 +39,13 @@ import com.ibm.watson.assistant.v2.model.DeleteSessionOptions; import com.ibm.watson.assistant.v2.model.DeleteUserDataOptions; import com.ibm.watson.assistant.v2.model.DeployReleaseOptions; +import com.ibm.watson.assistant.v2.model.DownloadReleaseExportOptions; import com.ibm.watson.assistant.v2.model.Environment; import com.ibm.watson.assistant.v2.model.EnvironmentCollection; import com.ibm.watson.assistant.v2.model.EnvironmentSkill; import com.ibm.watson.assistant.v2.model.ExportSkillsOptions; import com.ibm.watson.assistant.v2.model.GetEnvironmentOptions; +import com.ibm.watson.assistant.v2.model.GetReleaseImportStatusOptions; import com.ibm.watson.assistant.v2.model.GetReleaseOptions; import com.ibm.watson.assistant.v2.model.GetSkillOptions; import com.ibm.watson.assistant.v2.model.ImportSkillsOptions; @@ -46,6 +53,7 @@ import com.ibm.watson.assistant.v2.model.ListAssistantsOptions; import com.ibm.watson.assistant.v2.model.ListEnvironmentsOptions; import com.ibm.watson.assistant.v2.model.ListLogsOptions; +import com.ibm.watson.assistant.v2.model.ListProvidersOptions; import com.ibm.watson.assistant.v2.model.ListReleasesOptions; import com.ibm.watson.assistant.v2.model.LogCollection; import com.ibm.watson.assistant.v2.model.MessageContext; @@ -61,6 +69,22 @@ import com.ibm.watson.assistant.v2.model.MessageInputOptionsSpelling; import com.ibm.watson.assistant.v2.model.MessageOptions; import com.ibm.watson.assistant.v2.model.MessageStatelessOptions; +import com.ibm.watson.assistant.v2.model.MessageStreamOptions; +import com.ibm.watson.assistant.v2.model.MessageStreamStatelessOptions; +import com.ibm.watson.assistant.v2.model.MonitorAssistantReleaseImportArtifactResponse; +import com.ibm.watson.assistant.v2.model.ProviderAuthenticationOAuth2; +import com.ibm.watson.assistant.v2.model.ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password; +import com.ibm.watson.assistant.v2.model.ProviderAuthenticationOAuth2PasswordUsername; +import com.ibm.watson.assistant.v2.model.ProviderAuthenticationTypeAndValue; +import com.ibm.watson.assistant.v2.model.ProviderCollection; +import com.ibm.watson.assistant.v2.model.ProviderPrivate; +import com.ibm.watson.assistant.v2.model.ProviderPrivateAuthenticationBearerFlow; +import com.ibm.watson.assistant.v2.model.ProviderResponse; +import com.ibm.watson.assistant.v2.model.ProviderSpecification; +import com.ibm.watson.assistant.v2.model.ProviderSpecificationComponents; +import com.ibm.watson.assistant.v2.model.ProviderSpecificationComponentsSecuritySchemes; +import com.ibm.watson.assistant.v2.model.ProviderSpecificationComponentsSecuritySchemesBasic; +import com.ibm.watson.assistant.v2.model.ProviderSpecificationServersItem; import com.ibm.watson.assistant.v2.model.Release; import com.ibm.watson.assistant.v2.model.ReleaseCollection; import com.ibm.watson.assistant.v2.model.RequestAnalytics; @@ -70,10 +94,16 @@ import com.ibm.watson.assistant.v2.model.RuntimeEntityRole; import com.ibm.watson.assistant.v2.model.RuntimeIntent; import com.ibm.watson.assistant.v2.model.SearchSettings; +import com.ibm.watson.assistant.v2.model.SearchSettingsClientSideSearch; +import com.ibm.watson.assistant.v2.model.SearchSettingsConversationalSearch; +import com.ibm.watson.assistant.v2.model.SearchSettingsConversationalSearchResponseLength; +import com.ibm.watson.assistant.v2.model.SearchSettingsConversationalSearchSearchConfidence; import com.ibm.watson.assistant.v2.model.SearchSettingsDiscovery; import com.ibm.watson.assistant.v2.model.SearchSettingsDiscoveryAuthentication; +import com.ibm.watson.assistant.v2.model.SearchSettingsElasticSearch; import com.ibm.watson.assistant.v2.model.SearchSettingsMessages; import com.ibm.watson.assistant.v2.model.SearchSettingsSchemaMapping; +import com.ibm.watson.assistant.v2.model.SearchSettingsServerSideSearch; import com.ibm.watson.assistant.v2.model.SessionResponse; import com.ibm.watson.assistant.v2.model.Skill; import com.ibm.watson.assistant.v2.model.SkillImport; @@ -88,6 +118,8 @@ import com.ibm.watson.assistant.v2.model.StatelessMessageInputOptions; import com.ibm.watson.assistant.v2.model.StatelessMessageResponse; import com.ibm.watson.assistant.v2.model.UpdateEnvironmentOptions; +import com.ibm.watson.assistant.v2.model.UpdateEnvironmentOrchestration; +import com.ibm.watson.assistant.v2.model.UpdateProviderOptions; import com.ibm.watson.assistant.v2.model.UpdateSkillOptions; import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.IOException; @@ -127,6 +159,328 @@ public void testGetVersion() throws Throwable { assertEquals(assistantService.getVersion(), "testString"); } + // Test the createProvider operation with a valid options model parameter + @Test + public void testCreateProviderWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"provider_id\": \"providerId\", \"specification\": {\"servers\": [{\"url\": \"url\"}], \"components\": {\"securitySchemes\": {\"authentication_method\": \"basic\", \"basic\": {\"username\": {\"type\": \"value\", \"value\": \"value\"}}, \"oauth2\": {\"preferred_flow\": \"password\", \"flows\": {\"token_url\": \"tokenUrl\", \"refresh_url\": \"refreshUrl\", \"client_auth_type\": \"Body\", \"content_type\": \"contentType\", \"header_prefix\": \"headerPrefix\", \"username\": {\"type\": \"value\", \"value\": \"value\"}}}}}}}"; + String createProviderPath = "/v2/providers"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ProviderSpecificationServersItem model + ProviderSpecificationServersItem providerSpecificationServersItemModel = + new ProviderSpecificationServersItem.Builder().url("testString").build(); + + // Construct an instance of the ProviderAuthenticationTypeAndValue model + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + + // Construct an instance of the ProviderSpecificationComponentsSecuritySchemesBasic model + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + + // Construct an instance of the ProviderAuthenticationOAuth2PasswordUsername model + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + + // Construct an instance of the + // ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password model + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + + // Construct an instance of the ProviderAuthenticationOAuth2 model + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + + // Construct an instance of the ProviderSpecificationComponentsSecuritySchemes model + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + + // Construct an instance of the ProviderSpecificationComponents model + ProviderSpecificationComponents providerSpecificationComponentsModel = + new ProviderSpecificationComponents.Builder() + .securitySchemes(providerSpecificationComponentsSecuritySchemesModel) + .build(); + + // Construct an instance of the ProviderSpecification model + ProviderSpecification providerSpecificationModel = + new ProviderSpecification.Builder() + .servers(java.util.Arrays.asList(providerSpecificationServersItemModel)) + .components(providerSpecificationComponentsModel) + .build(); + + // Construct an instance of the ProviderPrivateAuthenticationBearerFlow model + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationModel = + new ProviderPrivateAuthenticationBearerFlow.Builder() + .token(providerAuthenticationTypeAndValueModel) + .build(); + + // Construct an instance of the ProviderPrivate model + ProviderPrivate providerPrivateModel = + new ProviderPrivate.Builder().authentication(providerPrivateAuthenticationModel).build(); + + // Construct an instance of the CreateProviderOptions model + CreateProviderOptions createProviderOptionsModel = + new CreateProviderOptions.Builder() + .providerId("testString") + .specification(providerSpecificationModel) + .xPrivate(providerPrivateModel) + .build(); + + // Invoke createProvider() with a valid options model and verify the result + Response response = + assistantService.createProvider(createProviderOptionsModel).execute(); + assertNotNull(response); + ProviderResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createProviderPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the createProvider operation with and without retries enabled + @Test + public void testCreateProviderWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testCreateProviderWOptions(); + + assistantService.disableRetries(); + testCreateProviderWOptions(); + } + + // Test the createProvider operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateProviderNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.createProvider(null).execute(); + } + + // Test the listProviders operation with a valid options model parameter + @Test + public void testListProvidersWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"conversational_skill_providers\": [{\"provider_id\": \"providerId\", \"specification\": {\"servers\": [{\"url\": \"url\"}], \"components\": {\"securitySchemes\": {\"authentication_method\": \"basic\", \"basic\": {\"username\": {\"type\": \"value\", \"value\": \"value\"}}, \"oauth2\": {\"preferred_flow\": \"password\", \"flows\": {\"token_url\": \"tokenUrl\", \"refresh_url\": \"refreshUrl\", \"client_auth_type\": \"Body\", \"content_type\": \"contentType\", \"header_prefix\": \"headerPrefix\", \"username\": {\"type\": \"value\", \"value\": \"value\"}}}}}}}], \"pagination\": {\"refresh_url\": \"refreshUrl\", \"next_url\": \"nextUrl\", \"total\": 5, \"matched\": 7, \"refresh_cursor\": \"refreshCursor\", \"next_cursor\": \"nextCursor\"}}"; + String listProvidersPath = "/v2/providers"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListProvidersOptions model + ListProvidersOptions listProvidersOptionsModel = + new ListProvidersOptions.Builder() + .pageLimit(Long.valueOf("100")) + .includeCount(false) + .sort("name") + .cursor("testString") + .includeAudit(false) + .build(); + + // Invoke listProviders() with a valid options model and verify the result + Response response = + assistantService.listProviders(listProvidersOptionsModel).execute(); + assertNotNull(response); + ProviderCollection responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listProvidersPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + assertEquals(Long.valueOf(query.get("page_limit")), Long.valueOf("100")); + assertEquals(Boolean.valueOf(query.get("include_count")), Boolean.valueOf(false)); + assertEquals(query.get("sort"), "name"); + assertEquals(query.get("cursor"), "testString"); + assertEquals(Boolean.valueOf(query.get("include_audit")), Boolean.valueOf(false)); + } + + // Test the listProviders operation with and without retries enabled + @Test + public void testListProvidersWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testListProvidersWOptions(); + + assistantService.disableRetries(); + testListProvidersWOptions(); + } + + // Test the updateProvider operation with a valid options model parameter + @Test + public void testUpdateProviderWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"provider_id\": \"providerId\", \"specification\": {\"servers\": [{\"url\": \"url\"}], \"components\": {\"securitySchemes\": {\"authentication_method\": \"basic\", \"basic\": {\"username\": {\"type\": \"value\", \"value\": \"value\"}}, \"oauth2\": {\"preferred_flow\": \"password\", \"flows\": {\"token_url\": \"tokenUrl\", \"refresh_url\": \"refreshUrl\", \"client_auth_type\": \"Body\", \"content_type\": \"contentType\", \"header_prefix\": \"headerPrefix\", \"username\": {\"type\": \"value\", \"value\": \"value\"}}}}}}}"; + String updateProviderPath = "/v2/providers/testString"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ProviderSpecificationServersItem model + ProviderSpecificationServersItem providerSpecificationServersItemModel = + new ProviderSpecificationServersItem.Builder().url("testString").build(); + + // Construct an instance of the ProviderAuthenticationTypeAndValue model + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + + // Construct an instance of the ProviderSpecificationComponentsSecuritySchemesBasic model + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + + // Construct an instance of the ProviderAuthenticationOAuth2PasswordUsername model + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + + // Construct an instance of the + // ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password model + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + + // Construct an instance of the ProviderAuthenticationOAuth2 model + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + + // Construct an instance of the ProviderSpecificationComponentsSecuritySchemes model + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + + // Construct an instance of the ProviderSpecificationComponents model + ProviderSpecificationComponents providerSpecificationComponentsModel = + new ProviderSpecificationComponents.Builder() + .securitySchemes(providerSpecificationComponentsSecuritySchemesModel) + .build(); + + // Construct an instance of the ProviderSpecification model + ProviderSpecification providerSpecificationModel = + new ProviderSpecification.Builder() + .servers(java.util.Arrays.asList(providerSpecificationServersItemModel)) + .components(providerSpecificationComponentsModel) + .build(); + + // Construct an instance of the ProviderPrivateAuthenticationBearerFlow model + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationModel = + new ProviderPrivateAuthenticationBearerFlow.Builder() + .token(providerAuthenticationTypeAndValueModel) + .build(); + + // Construct an instance of the ProviderPrivate model + ProviderPrivate providerPrivateModel = + new ProviderPrivate.Builder().authentication(providerPrivateAuthenticationModel).build(); + + // Construct an instance of the UpdateProviderOptions model + UpdateProviderOptions updateProviderOptionsModel = + new UpdateProviderOptions.Builder() + .providerId("testString") + .specification(providerSpecificationModel) + .xPrivate(providerPrivateModel) + .build(); + + // Invoke updateProvider() with a valid options model and verify the result + Response response = + assistantService.updateProvider(updateProviderOptionsModel).execute(); + assertNotNull(response); + ProviderResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, updateProviderPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the updateProvider operation with and without retries enabled + @Test + public void testUpdateProviderWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testUpdateProviderWOptions(); + + assistantService.disableRetries(); + testUpdateProviderWOptions(); + } + + // Test the updateProvider operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateProviderNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.updateProvider(null).execute(); + } + // Test the createAssistant operation with a valid options model parameter @Test public void testCreateAssistantWOptions() throws Throwable { @@ -584,6 +938,7 @@ public void testMessageWOptions() throws Throwable { MessageOptions messageOptionsModel = new MessageOptions.Builder() .assistantId("testString") + .environmentId("testString") .sessionId("testString") .input(messageInputModel) .context(messageContextModel) @@ -799,32 +1154,490 @@ public void testMessageStatelessWOptions() throws Throwable { StatelessMessageContextSkills statelessMessageContextSkillsModel = new StatelessMessageContextSkills.Builder() .mainSkill(messageContextDialogSkillModel) - .actionsSkill(statelessMessageContextSkillsActionsSkillModel) + .actionsSkill(statelessMessageContextSkillsActionsSkillModel) + .build(); + + // Construct an instance of the StatelessMessageContext model + StatelessMessageContext statelessMessageContextModel = + new StatelessMessageContext.Builder() + .global(statelessMessageContextGlobalModel) + .skills(statelessMessageContextSkillsModel) + .integrations(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + + // Construct an instance of the MessageStatelessOptions model + MessageStatelessOptions messageStatelessOptionsModel = + new MessageStatelessOptions.Builder() + .assistantId("testString") + .environmentId("testString") + .input(statelessMessageInputModel) + .context(statelessMessageContextModel) + .userId("testString") + .build(); + + // Invoke messageStateless() with a valid options model and verify the result + Response response = + assistantService.messageStateless(messageStatelessOptionsModel).execute(); + assertNotNull(response); + StatelessMessageResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, messageStatelessPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the messageStateless operation with and without retries enabled + @Test + public void testMessageStatelessWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testMessageStatelessWOptions(); + + assistantService.disableRetries(); + testMessageStatelessWOptions(); + } + + // Test the messageStateless operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testMessageStatelessNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.messageStateless(null).execute(); + } + + // Test the messageStream operation with a valid options model parameter + @Test + public void testMessageStreamWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "This is a mock binary response."; + String messageStreamPath = + "/v2/assistants/testString/environments/testString/sessions/testString/message_stream"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "text/event-stream") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the RuntimeIntent model + RuntimeIntent runtimeIntentModel = + new RuntimeIntent.Builder() + .intent("testString") + .confidence(Double.valueOf("72.5")) + .skill("testString") + .build(); + + // Construct an instance of the CaptureGroup model + CaptureGroup captureGroupModel = + new CaptureGroup.Builder() + .group("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .build(); + + // Construct an instance of the RuntimeEntityInterpretation model + RuntimeEntityInterpretation runtimeEntityInterpretationModel = + new RuntimeEntityInterpretation.Builder() + .calendarType("testString") + .datetimeLink("testString") + .festival("testString") + .granularity("day") + .rangeLink("testString") + .rangeModifier("testString") + .relativeDay(Double.valueOf("72.5")) + .relativeMonth(Double.valueOf("72.5")) + .relativeWeek(Double.valueOf("72.5")) + .relativeWeekend(Double.valueOf("72.5")) + .relativeYear(Double.valueOf("72.5")) + .specificDay(Double.valueOf("72.5")) + .specificDayOfWeek("testString") + .specificMonth(Double.valueOf("72.5")) + .specificQuarter(Double.valueOf("72.5")) + .specificYear(Double.valueOf("72.5")) + .numericValue(Double.valueOf("72.5")) + .subtype("testString") + .partOfDay("testString") + .relativeHour(Double.valueOf("72.5")) + .relativeMinute(Double.valueOf("72.5")) + .relativeSecond(Double.valueOf("72.5")) + .specificHour(Double.valueOf("72.5")) + .specificMinute(Double.valueOf("72.5")) + .specificSecond(Double.valueOf("72.5")) + .timezone("testString") + .build(); + + // Construct an instance of the RuntimeEntityAlternative model + RuntimeEntityAlternative runtimeEntityAlternativeModel = + new RuntimeEntityAlternative.Builder() + .value("testString") + .confidence(Double.valueOf("72.5")) + .build(); + + // Construct an instance of the RuntimeEntityRole model + RuntimeEntityRole runtimeEntityRoleModel = + new RuntimeEntityRole.Builder().type("date_from").build(); + + // Construct an instance of the RuntimeEntity model + RuntimeEntity runtimeEntityModel = + new RuntimeEntity.Builder() + .entity("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .value("testString") + .confidence(Double.valueOf("72.5")) + .groups(java.util.Arrays.asList(captureGroupModel)) + .interpretation(runtimeEntityInterpretationModel) + .alternatives(java.util.Arrays.asList(runtimeEntityAlternativeModel)) + .role(runtimeEntityRoleModel) + .skill("testString") + .build(); + + // Construct an instance of the MessageInputAttachment model + MessageInputAttachment messageInputAttachmentModel = + new MessageInputAttachment.Builder().url("testString").mediaType("testString").build(); + + // Construct an instance of the RequestAnalytics model + RequestAnalytics requestAnalyticsModel = + new RequestAnalytics.Builder() + .browser("testString") + .device("testString") + .pageUrl("testString") + .build(); + + // Construct an instance of the MessageInputOptionsSpelling model + MessageInputOptionsSpelling messageInputOptionsSpellingModel = + new MessageInputOptionsSpelling.Builder().suggestions(true).autoCorrect(true).build(); + + // Construct an instance of the MessageInputOptions model + MessageInputOptions messageInputOptionsModel = + new MessageInputOptions.Builder() + .restart(false) + .alternateIntents(false) + .asyncCallout(false) + .spelling(messageInputOptionsSpellingModel) + .debug(false) + .returnContext(false) + .export(false) + .build(); + + // Construct an instance of the MessageInput model + MessageInput messageInputModel = + new MessageInput.Builder() + .messageType("text") + .text("testString") + .intents(java.util.Arrays.asList(runtimeIntentModel)) + .entities(java.util.Arrays.asList(runtimeEntityModel)) + .suggestionId("testString") + .attachments(java.util.Arrays.asList(messageInputAttachmentModel)) + .analytics(requestAnalyticsModel) + .options(messageInputOptionsModel) + .build(); + + // Construct an instance of the MessageContextGlobalSystem model + MessageContextGlobalSystem messageContextGlobalSystemModel = + new MessageContextGlobalSystem.Builder() + .timezone("testString") + .userId("testString") + .turnCount(Long.valueOf("26")) + .locale("en-us") + .referenceTime("testString") + .sessionStartTime("testString") + .state("testString") + .skipUserInput(true) + .build(); + + // Construct an instance of the MessageContextGlobal model + MessageContextGlobal messageContextGlobalModel = + new MessageContextGlobal.Builder().system(messageContextGlobalSystemModel).build(); + + // Construct an instance of the MessageContextSkillSystem model + MessageContextSkillSystem messageContextSkillSystemModel = + new MessageContextSkillSystem.Builder() + .state("testString") + .add("foo", "testString") + .build(); + + // Construct an instance of the MessageContextDialogSkill model + MessageContextDialogSkill messageContextDialogSkillModel = + new MessageContextDialogSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .build(); + + // Construct an instance of the MessageContextActionSkill model + MessageContextActionSkill messageContextActionSkillModel = + new MessageContextActionSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .actionVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .skillVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + + // Construct an instance of the MessageContextSkills model + MessageContextSkills messageContextSkillsModel = + new MessageContextSkills.Builder() + .mainSkill(messageContextDialogSkillModel) + .actionsSkill(messageContextActionSkillModel) + .build(); + + // Construct an instance of the MessageContext model + MessageContext messageContextModel = + new MessageContext.Builder() + .global(messageContextGlobalModel) + .skills(messageContextSkillsModel) + .integrations(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + + // Construct an instance of the MessageStreamOptions model + MessageStreamOptions messageStreamOptionsModel = + new MessageStreamOptions.Builder() + .assistantId("testString") + .environmentId("testString") + .sessionId("testString") + .input(messageInputModel) + .context(messageContextModel) + .userId("testString") + .build(); + + // Invoke messageStream() with a valid options model and verify the result + Response response = + assistantService.messageStream(messageStreamOptionsModel).execute(); + assertNotNull(response); + try (InputStream responseObj = response.getResult(); ) { + assertNotNull(responseObj); + } + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, messageStreamPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the messageStream operation with and without retries enabled + @Test + public void testMessageStreamWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testMessageStreamWOptions(); + + assistantService.disableRetries(); + testMessageStreamWOptions(); + } + + // Test the messageStream operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testMessageStreamNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.messageStream(null).execute(); + } + + // Test the messageStreamStateless operation with a valid options model parameter + @Test + public void testMessageStreamStatelessWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "This is a mock binary response."; + String messageStreamStatelessPath = + "/v2/assistants/testString/environments/testString/message_stream"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "text/event-stream") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the RuntimeIntent model + RuntimeIntent runtimeIntentModel = + new RuntimeIntent.Builder() + .intent("testString") + .confidence(Double.valueOf("72.5")) + .skill("testString") + .build(); + + // Construct an instance of the CaptureGroup model + CaptureGroup captureGroupModel = + new CaptureGroup.Builder() + .group("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .build(); + + // Construct an instance of the RuntimeEntityInterpretation model + RuntimeEntityInterpretation runtimeEntityInterpretationModel = + new RuntimeEntityInterpretation.Builder() + .calendarType("testString") + .datetimeLink("testString") + .festival("testString") + .granularity("day") + .rangeLink("testString") + .rangeModifier("testString") + .relativeDay(Double.valueOf("72.5")) + .relativeMonth(Double.valueOf("72.5")) + .relativeWeek(Double.valueOf("72.5")) + .relativeWeekend(Double.valueOf("72.5")) + .relativeYear(Double.valueOf("72.5")) + .specificDay(Double.valueOf("72.5")) + .specificDayOfWeek("testString") + .specificMonth(Double.valueOf("72.5")) + .specificQuarter(Double.valueOf("72.5")) + .specificYear(Double.valueOf("72.5")) + .numericValue(Double.valueOf("72.5")) + .subtype("testString") + .partOfDay("testString") + .relativeHour(Double.valueOf("72.5")) + .relativeMinute(Double.valueOf("72.5")) + .relativeSecond(Double.valueOf("72.5")) + .specificHour(Double.valueOf("72.5")) + .specificMinute(Double.valueOf("72.5")) + .specificSecond(Double.valueOf("72.5")) + .timezone("testString") + .build(); + + // Construct an instance of the RuntimeEntityAlternative model + RuntimeEntityAlternative runtimeEntityAlternativeModel = + new RuntimeEntityAlternative.Builder() + .value("testString") + .confidence(Double.valueOf("72.5")) + .build(); + + // Construct an instance of the RuntimeEntityRole model + RuntimeEntityRole runtimeEntityRoleModel = + new RuntimeEntityRole.Builder().type("date_from").build(); + + // Construct an instance of the RuntimeEntity model + RuntimeEntity runtimeEntityModel = + new RuntimeEntity.Builder() + .entity("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .value("testString") + .confidence(Double.valueOf("72.5")) + .groups(java.util.Arrays.asList(captureGroupModel)) + .interpretation(runtimeEntityInterpretationModel) + .alternatives(java.util.Arrays.asList(runtimeEntityAlternativeModel)) + .role(runtimeEntityRoleModel) + .skill("testString") + .build(); + + // Construct an instance of the MessageInputAttachment model + MessageInputAttachment messageInputAttachmentModel = + new MessageInputAttachment.Builder().url("testString").mediaType("testString").build(); + + // Construct an instance of the RequestAnalytics model + RequestAnalytics requestAnalyticsModel = + new RequestAnalytics.Builder() + .browser("testString") + .device("testString") + .pageUrl("testString") + .build(); + + // Construct an instance of the MessageInputOptionsSpelling model + MessageInputOptionsSpelling messageInputOptionsSpellingModel = + new MessageInputOptionsSpelling.Builder().suggestions(true).autoCorrect(true).build(); + + // Construct an instance of the MessageInputOptions model + MessageInputOptions messageInputOptionsModel = + new MessageInputOptions.Builder() + .restart(false) + .alternateIntents(false) + .asyncCallout(false) + .spelling(messageInputOptionsSpellingModel) + .debug(false) + .returnContext(false) + .export(false) + .build(); + + // Construct an instance of the MessageInput model + MessageInput messageInputModel = + new MessageInput.Builder() + .messageType("text") + .text("testString") + .intents(java.util.Arrays.asList(runtimeIntentModel)) + .entities(java.util.Arrays.asList(runtimeEntityModel)) + .suggestionId("testString") + .attachments(java.util.Arrays.asList(messageInputAttachmentModel)) + .analytics(requestAnalyticsModel) + .options(messageInputOptionsModel) + .build(); + + // Construct an instance of the MessageContextGlobalSystem model + MessageContextGlobalSystem messageContextGlobalSystemModel = + new MessageContextGlobalSystem.Builder() + .timezone("testString") + .userId("testString") + .turnCount(Long.valueOf("26")) + .locale("en-us") + .referenceTime("testString") + .sessionStartTime("testString") + .state("testString") + .skipUserInput(true) + .build(); + + // Construct an instance of the MessageContextGlobal model + MessageContextGlobal messageContextGlobalModel = + new MessageContextGlobal.Builder().system(messageContextGlobalSystemModel).build(); + + // Construct an instance of the MessageContextSkillSystem model + MessageContextSkillSystem messageContextSkillSystemModel = + new MessageContextSkillSystem.Builder() + .state("testString") + .add("foo", "testString") + .build(); + + // Construct an instance of the MessageContextDialogSkill model + MessageContextDialogSkill messageContextDialogSkillModel = + new MessageContextDialogSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .build(); + + // Construct an instance of the MessageContextActionSkill model + MessageContextActionSkill messageContextActionSkillModel = + new MessageContextActionSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .actionVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .skillVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + + // Construct an instance of the MessageContextSkills model + MessageContextSkills messageContextSkillsModel = + new MessageContextSkills.Builder() + .mainSkill(messageContextDialogSkillModel) + .actionsSkill(messageContextActionSkillModel) .build(); - // Construct an instance of the StatelessMessageContext model - StatelessMessageContext statelessMessageContextModel = - new StatelessMessageContext.Builder() - .global(statelessMessageContextGlobalModel) - .skills(statelessMessageContextSkillsModel) + // Construct an instance of the MessageContext model + MessageContext messageContextModel = + new MessageContext.Builder() + .global(messageContextGlobalModel) + .skills(messageContextSkillsModel) .integrations(java.util.Collections.singletonMap("anyKey", "anyValue")) .build(); - // Construct an instance of the MessageStatelessOptions model - MessageStatelessOptions messageStatelessOptionsModel = - new MessageStatelessOptions.Builder() + // Construct an instance of the MessageStreamStatelessOptions model + MessageStreamStatelessOptions messageStreamStatelessOptionsModel = + new MessageStreamStatelessOptions.Builder() .assistantId("testString") - .input(statelessMessageInputModel) - .context(statelessMessageContextModel) + .environmentId("testString") + .input(messageInputModel) + .context(messageContextModel) .userId("testString") .build(); - // Invoke messageStateless() with a valid options model and verify the result - Response response = - assistantService.messageStateless(messageStatelessOptionsModel).execute(); + // Invoke messageStreamStateless() with a valid options model and verify the result + Response response = + assistantService.messageStreamStateless(messageStreamStatelessOptionsModel).execute(); assertNotNull(response); - StatelessMessageResponse responseObj = response.getResult(); - assertNotNull(responseObj); + try (InputStream responseObj = response.getResult(); ) { + assertNotNull(responseObj); + } // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); @@ -832,28 +1645,28 @@ public void testMessageStatelessWOptions() throws Throwable { assertEquals(request.getMethod(), "POST"); // Verify request path String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, messageStatelessPath); + assertEquals(parsedPath, messageStreamStatelessPath); // Verify query params Map query = TestUtilities.parseQueryString(request); assertNotNull(query); assertEquals(query.get("version"), "testString"); } - // Test the messageStateless operation with and without retries enabled + // Test the messageStreamStateless operation with and without retries enabled @Test - public void testMessageStatelessWRetries() throws Throwable { + public void testMessageStreamStatelessWRetries() throws Throwable { assistantService.enableRetries(4, 30); - testMessageStatelessWOptions(); + testMessageStreamStatelessWOptions(); assistantService.disableRetries(); - testMessageStatelessWOptions(); + testMessageStreamStatelessWOptions(); } - // Test the messageStateless operation with a null options model (negative test) + // Test the messageStreamStateless operation with a null options model (negative test) @Test(expectedExceptions = IllegalArgumentException.class) - public void testMessageStatelessNoOptions() throws Throwable { + public void testMessageStreamStatelessNoOptions() throws Throwable { server.enqueue(new MockResponse()); - assistantService.messageStateless(null).execute(); + assistantService.messageStreamStateless(null).execute(); } // Test the bulkClassify operation with a valid options model parameter @@ -1167,9 +1980,9 @@ public void testUpdateEnvironmentWOptions() throws Throwable { .setResponseCode(200) .setBody(mockResponseBody)); - // Construct an instance of the BaseEnvironmentOrchestration model - BaseEnvironmentOrchestration baseEnvironmentOrchestrationModel = - new BaseEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); + // Construct an instance of the UpdateEnvironmentOrchestration model + UpdateEnvironmentOrchestration updateEnvironmentOrchestrationModel = + new UpdateEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); // Construct an instance of the EnvironmentSkill model EnvironmentSkill environmentSkillModel = @@ -1188,7 +2001,7 @@ public void testUpdateEnvironmentWOptions() throws Throwable { .environmentId("testString") .name("testString") .description("testString") - .orchestration(baseEnvironmentOrchestrationModel) + .orchestration(updateEnvironmentOrchestrationModel) .sessionTimeout(Long.valueOf("10")) .skillReferences(java.util.Arrays.asList(environmentSkillModel)) .build(); @@ -1519,12 +2332,307 @@ public void testDeployReleaseNoOptions() throws Throwable { assistantService.deployRelease(null).execute(); } + // Test the createReleaseExport operation with a valid options model parameter + @Test + public void testCreateReleaseExportWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"status\": \"Available\", \"task_id\": \"taskId\", \"assistant_id\": \"assistantId\", \"release\": \"release\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\"}"; + String createReleaseExportPath = "/v2/assistants/testString/releases/testString/export"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the CreateReleaseExportOptions model + CreateReleaseExportOptions createReleaseExportOptionsModel = + new CreateReleaseExportOptions.Builder() + .assistantId("testString") + .release("testString") + .includeAudit(false) + .build(); + + // Invoke createReleaseExport() with a valid options model and verify the result + Response response = + assistantService.createReleaseExport(createReleaseExportOptionsModel).execute(); + assertNotNull(response); + CreateReleaseExportWithStatusErrors responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createReleaseExportPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + assertEquals(Boolean.valueOf(query.get("include_audit")), Boolean.valueOf(false)); + } + + // Test the createReleaseExport operation with and without retries enabled + @Test + public void testCreateReleaseExportWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testCreateReleaseExportWOptions(); + + assistantService.disableRetries(); + testCreateReleaseExportWOptions(); + } + + // Test the createReleaseExport operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateReleaseExportNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.createReleaseExport(null).execute(); + } + + // Test the downloadReleaseExport operation with a valid options model parameter + @Test + public void testDownloadReleaseExportWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"status\": \"Available\", \"task_id\": \"taskId\", \"assistant_id\": \"assistantId\", \"release\": \"release\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\"}"; + String downloadReleaseExportPath = "/v2/assistants/testString/releases/testString/export"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the DownloadReleaseExportOptions model + DownloadReleaseExportOptions downloadReleaseExportOptionsModel = + new DownloadReleaseExportOptions.Builder() + .assistantId("testString") + .release("testString") + .includeAudit(false) + .build(); + + // Invoke downloadReleaseExport() with a valid options model and verify the result + Response response = + assistantService.downloadReleaseExport(downloadReleaseExportOptionsModel).execute(); + assertNotNull(response); + CreateReleaseExportWithStatusErrors responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, downloadReleaseExportPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + assertEquals(Boolean.valueOf(query.get("include_audit")), Boolean.valueOf(false)); + } + + // Test the downloadReleaseExport operation with and without retries enabled + @Test + public void testDownloadReleaseExportWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testDownloadReleaseExportWOptions(); + + assistantService.disableRetries(); + testDownloadReleaseExportWOptions(); + } + + // Test the downloadReleaseExport operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDownloadReleaseExportNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.downloadReleaseExport(null).execute(); + } + + // Test the downloadReleaseExportAsStream operation with a valid options model parameter + @Test + public void testDownloadReleaseExportAsStreamWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "This is a mock binary response."; + String downloadReleaseExportAsStreamPath = + "/v2/assistants/testString/releases/testString/export"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/octet-stream") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the DownloadReleaseExportOptions model + DownloadReleaseExportOptions downloadReleaseExportOptionsModel = + new DownloadReleaseExportOptions.Builder() + .assistantId("testString") + .release("testString") + .includeAudit(false) + .build(); + + // Invoke downloadReleaseExportAsStream() with a valid options model and verify the result + Response response = + assistantService.downloadReleaseExportAsStream(downloadReleaseExportOptionsModel).execute(); + assertNotNull(response); + try (InputStream responseObj = response.getResult(); ) { + assertNotNull(responseObj); + } + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, downloadReleaseExportAsStreamPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + assertEquals(Boolean.valueOf(query.get("include_audit")), Boolean.valueOf(false)); + } + + // Test the downloadReleaseExportAsStream operation with and without retries enabled + @Test + public void testDownloadReleaseExportAsStreamWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testDownloadReleaseExportAsStreamWOptions(); + + assistantService.disableRetries(); + testDownloadReleaseExportAsStreamWOptions(); + } + + // Test the downloadReleaseExportAsStream operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testDownloadReleaseExportAsStreamNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.downloadReleaseExportAsStream(null).execute(); + } + + // Test the createReleaseImport operation with a valid options model parameter + @Test + public void testCreateReleaseImportWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"status\": \"Failed\", \"task_id\": \"taskId\", \"assistant_id\": \"assistantId\", \"skill_impact_in_draft\": [\"action\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; + String createReleaseImportPath = "/v2/assistants/testString/import"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the CreateReleaseImportOptions model + CreateReleaseImportOptions createReleaseImportOptionsModel = + new CreateReleaseImportOptions.Builder() + .assistantId("testString") + .body(TestUtilities.createMockStream("This is a mock file.")) + .includeAudit(false) + .build(); + + // Invoke createReleaseImport() with a valid options model and verify the result + Response response = + assistantService.createReleaseImport(createReleaseImportOptionsModel).execute(); + assertNotNull(response); + CreateAssistantReleaseImportResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, createReleaseImportPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + assertEquals(Boolean.valueOf(query.get("include_audit")), Boolean.valueOf(false)); + } + + // Test the createReleaseImport operation with and without retries enabled + @Test + public void testCreateReleaseImportWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testCreateReleaseImportWOptions(); + + assistantService.disableRetries(); + testCreateReleaseImportWOptions(); + } + + // Test the createReleaseImport operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateReleaseImportNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.createReleaseImport(null).execute(); + } + + // Test the getReleaseImportStatus operation with a valid options model parameter + @Test + public void testGetReleaseImportStatusWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"status\": \"Completed\", \"task_id\": \"taskId\", \"assistant_id\": \"assistantId\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"skill_impact_in_draft\": [\"action\"], \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\"}"; + String getReleaseImportStatusPath = "/v2/assistants/testString/import"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the GetReleaseImportStatusOptions model + GetReleaseImportStatusOptions getReleaseImportStatusOptionsModel = + new GetReleaseImportStatusOptions.Builder() + .assistantId("testString") + .includeAudit(false) + .build(); + + // Invoke getReleaseImportStatus() with a valid options model and verify the result + Response response = + assistantService.getReleaseImportStatus(getReleaseImportStatusOptionsModel).execute(); + assertNotNull(response); + MonitorAssistantReleaseImportArtifactResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, getReleaseImportStatusPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + assertEquals(Boolean.valueOf(query.get("include_audit")), Boolean.valueOf(false)); + } + + // Test the getReleaseImportStatus operation with and without retries enabled + @Test + public void testGetReleaseImportStatusWRetries() throws Throwable { + assistantService.enableRetries(4, 30); + testGetReleaseImportStatusWOptions(); + + assistantService.disableRetries(); + testGetReleaseImportStatusWOptions(); + } + + // Test the getReleaseImportStatus operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testGetReleaseImportStatusNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + assistantService.getReleaseImportStatus(null).execute(); + } + // Test the getSkill operation with a valid options model parameter @Test public void testGetSkillWOptions() throws Throwable { // Register a mock response String mockResponseBody = - "{\"name\": \"name\", \"description\": \"description\", \"workspace\": {\"anyKey\": \"anyValue\"}, \"skill_id\": \"skillId\", \"status\": \"Available\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"dialog_settings\": {\"anyKey\": \"anyValue\"}, \"assistant_id\": \"assistantId\", \"workspace_id\": \"workspaceId\", \"environment_id\": \"environmentId\", \"valid\": false, \"next_snapshot_version\": \"nextSnapshotVersion\", \"search_settings\": {\"discovery\": {\"instance_id\": \"instanceId\", \"project_id\": \"projectId\", \"url\": \"url\", \"max_primary_results\": 10000, \"max_total_results\": 10000, \"confidence_threshold\": 0.0, \"highlight\": false, \"find_answers\": false, \"authentication\": {\"basic\": \"basic\", \"bearer\": \"bearer\"}}, \"messages\": {\"success\": \"success\", \"error\": \"error\", \"no_result\": \"noResult\"}, \"schema_mapping\": {\"url\": \"url\", \"body\": \"body\", \"title\": \"title\"}}, \"warnings\": [{\"code\": \"code\", \"path\": \"path\", \"message\": \"message\"}], \"language\": \"language\", \"type\": \"action\"}"; + "{\"name\": \"name\", \"description\": \"description\", \"workspace\": {\"anyKey\": \"anyValue\"}, \"skill_id\": \"skillId\", \"status\": \"Available\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"dialog_settings\": {\"anyKey\": \"anyValue\"}, \"assistant_id\": \"assistantId\", \"workspace_id\": \"workspaceId\", \"environment_id\": \"environmentId\", \"valid\": false, \"next_snapshot_version\": \"nextSnapshotVersion\", \"search_settings\": {\"discovery\": {\"instance_id\": \"instanceId\", \"project_id\": \"projectId\", \"url\": \"url\", \"max_primary_results\": 10000, \"max_total_results\": 10000, \"confidence_threshold\": 0.0, \"highlight\": false, \"find_answers\": false, \"authentication\": {\"basic\": \"basic\", \"bearer\": \"bearer\"}}, \"messages\": {\"success\": \"success\", \"error\": \"error\", \"no_result\": \"noResult\"}, \"schema_mapping\": {\"url\": \"url\", \"body\": \"body\", \"title\": \"title\"}, \"elastic_search\": {\"url\": \"url\", \"port\": \"port\", \"username\": \"username\", \"password\": \"password\", \"index\": \"index\", \"filter\": [\"anyValue\"], \"query_body\": {\"anyKey\": \"anyValue\"}, \"managed_index\": \"managedIndex\", \"apikey\": \"apikey\"}, \"conversational_search\": {\"enabled\": true, \"response_length\": {\"option\": \"moderate\"}, \"search_confidence\": {\"threshold\": \"less_often\"}}, \"server_side_search\": {\"url\": \"url\", \"port\": \"port\", \"username\": \"username\", \"password\": \"password\", \"filter\": \"filter\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"apikey\": \"apikey\", \"no_auth\": true, \"auth_type\": \"basic\"}, \"client_side_search\": {\"filter\": \"filter\", \"metadata\": {\"anyKey\": \"anyValue\"}}}, \"warnings\": [{\"code\": \"code\", \"path\": \"path\", \"message\": \"message\"}], \"language\": \"language\", \"type\": \"action\"}"; String getSkillPath = "/v2/assistants/testString/skills/testString"; server.enqueue( new MockResponse() @@ -1577,7 +2685,7 @@ public void testGetSkillNoOptions() throws Throwable { public void testUpdateSkillWOptions() throws Throwable { // Register a mock response String mockResponseBody = - "{\"name\": \"name\", \"description\": \"description\", \"workspace\": {\"anyKey\": \"anyValue\"}, \"skill_id\": \"skillId\", \"status\": \"Available\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"dialog_settings\": {\"anyKey\": \"anyValue\"}, \"assistant_id\": \"assistantId\", \"workspace_id\": \"workspaceId\", \"environment_id\": \"environmentId\", \"valid\": false, \"next_snapshot_version\": \"nextSnapshotVersion\", \"search_settings\": {\"discovery\": {\"instance_id\": \"instanceId\", \"project_id\": \"projectId\", \"url\": \"url\", \"max_primary_results\": 10000, \"max_total_results\": 10000, \"confidence_threshold\": 0.0, \"highlight\": false, \"find_answers\": false, \"authentication\": {\"basic\": \"basic\", \"bearer\": \"bearer\"}}, \"messages\": {\"success\": \"success\", \"error\": \"error\", \"no_result\": \"noResult\"}, \"schema_mapping\": {\"url\": \"url\", \"body\": \"body\", \"title\": \"title\"}}, \"warnings\": [{\"code\": \"code\", \"path\": \"path\", \"message\": \"message\"}], \"language\": \"language\", \"type\": \"action\"}"; + "{\"name\": \"name\", \"description\": \"description\", \"workspace\": {\"anyKey\": \"anyValue\"}, \"skill_id\": \"skillId\", \"status\": \"Available\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"dialog_settings\": {\"anyKey\": \"anyValue\"}, \"assistant_id\": \"assistantId\", \"workspace_id\": \"workspaceId\", \"environment_id\": \"environmentId\", \"valid\": false, \"next_snapshot_version\": \"nextSnapshotVersion\", \"search_settings\": {\"discovery\": {\"instance_id\": \"instanceId\", \"project_id\": \"projectId\", \"url\": \"url\", \"max_primary_results\": 10000, \"max_total_results\": 10000, \"confidence_threshold\": 0.0, \"highlight\": false, \"find_answers\": false, \"authentication\": {\"basic\": \"basic\", \"bearer\": \"bearer\"}}, \"messages\": {\"success\": \"success\", \"error\": \"error\", \"no_result\": \"noResult\"}, \"schema_mapping\": {\"url\": \"url\", \"body\": \"body\", \"title\": \"title\"}, \"elastic_search\": {\"url\": \"url\", \"port\": \"port\", \"username\": \"username\", \"password\": \"password\", \"index\": \"index\", \"filter\": [\"anyValue\"], \"query_body\": {\"anyKey\": \"anyValue\"}, \"managed_index\": \"managedIndex\", \"apikey\": \"apikey\"}, \"conversational_search\": {\"enabled\": true, \"response_length\": {\"option\": \"moderate\"}, \"search_confidence\": {\"threshold\": \"less_often\"}}, \"server_side_search\": {\"url\": \"url\", \"port\": \"port\", \"username\": \"username\", \"password\": \"password\", \"filter\": \"filter\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"apikey\": \"apikey\", \"no_auth\": true, \"auth_type\": \"basic\"}, \"client_side_search\": {\"filter\": \"filter\", \"metadata\": {\"anyKey\": \"anyValue\"}}}, \"warnings\": [{\"code\": \"code\", \"path\": \"path\", \"message\": \"message\"}], \"language\": \"language\", \"type\": \"action\"}"; String updateSkillPath = "/v2/assistants/testString/skills/testString"; server.enqueue( new MockResponse() @@ -1622,12 +2730,73 @@ public void testUpdateSkillWOptions() throws Throwable { .title("testString") .build(); + // Construct an instance of the SearchSettingsElasticSearch model + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + + // Construct an instance of the SearchSettingsConversationalSearchResponseLength model + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + + // Construct an instance of the SearchSettingsConversationalSearchSearchConfidence model + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + + // Construct an instance of the SearchSettingsConversationalSearch model + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + + // Construct an instance of the SearchSettingsServerSideSearch model + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + + // Construct an instance of the SearchSettingsClientSideSearch model + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + // Construct an instance of the SearchSettings model SearchSettings searchSettingsModel = new SearchSettings.Builder() .discovery(searchSettingsDiscoveryModel) .messages(searchSettingsMessagesModel) .schemaMapping(searchSettingsSchemaMappingModel) + .elasticSearch(searchSettingsElasticSearchModel) + .conversationalSearch(searchSettingsConversationalSearchModel) + .serverSideSearch(searchSettingsServerSideSearchModel) + .clientSideSearch(searchSettingsClientSideSearchModel) .build(); // Construct an instance of the UpdateSkillOptions model @@ -1683,7 +2852,7 @@ public void testUpdateSkillNoOptions() throws Throwable { public void testExportSkillsWOptions() throws Throwable { // Register a mock response String mockResponseBody = - "{\"assistant_skills\": [{\"name\": \"name\", \"description\": \"description\", \"workspace\": {\"anyKey\": \"anyValue\"}, \"skill_id\": \"skillId\", \"status\": \"Available\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"dialog_settings\": {\"anyKey\": \"anyValue\"}, \"assistant_id\": \"assistantId\", \"workspace_id\": \"workspaceId\", \"environment_id\": \"environmentId\", \"valid\": false, \"next_snapshot_version\": \"nextSnapshotVersion\", \"search_settings\": {\"discovery\": {\"instance_id\": \"instanceId\", \"project_id\": \"projectId\", \"url\": \"url\", \"max_primary_results\": 10000, \"max_total_results\": 10000, \"confidence_threshold\": 0.0, \"highlight\": false, \"find_answers\": false, \"authentication\": {\"basic\": \"basic\", \"bearer\": \"bearer\"}}, \"messages\": {\"success\": \"success\", \"error\": \"error\", \"no_result\": \"noResult\"}, \"schema_mapping\": {\"url\": \"url\", \"body\": \"body\", \"title\": \"title\"}}, \"warnings\": [{\"code\": \"code\", \"path\": \"path\", \"message\": \"message\"}], \"language\": \"language\", \"type\": \"action\"}], \"assistant_state\": {\"action_disabled\": true, \"dialog_disabled\": true}}"; + "{\"assistant_skills\": [{\"name\": \"name\", \"description\": \"description\", \"workspace\": {\"anyKey\": \"anyValue\"}, \"skill_id\": \"skillId\", \"status\": \"Available\", \"status_errors\": [{\"message\": \"message\"}], \"status_description\": \"statusDescription\", \"dialog_settings\": {\"anyKey\": \"anyValue\"}, \"assistant_id\": \"assistantId\", \"workspace_id\": \"workspaceId\", \"environment_id\": \"environmentId\", \"valid\": false, \"next_snapshot_version\": \"nextSnapshotVersion\", \"search_settings\": {\"discovery\": {\"instance_id\": \"instanceId\", \"project_id\": \"projectId\", \"url\": \"url\", \"max_primary_results\": 10000, \"max_total_results\": 10000, \"confidence_threshold\": 0.0, \"highlight\": false, \"find_answers\": false, \"authentication\": {\"basic\": \"basic\", \"bearer\": \"bearer\"}}, \"messages\": {\"success\": \"success\", \"error\": \"error\", \"no_result\": \"noResult\"}, \"schema_mapping\": {\"url\": \"url\", \"body\": \"body\", \"title\": \"title\"}, \"elastic_search\": {\"url\": \"url\", \"port\": \"port\", \"username\": \"username\", \"password\": \"password\", \"index\": \"index\", \"filter\": [\"anyValue\"], \"query_body\": {\"anyKey\": \"anyValue\"}, \"managed_index\": \"managedIndex\", \"apikey\": \"apikey\"}, \"conversational_search\": {\"enabled\": true, \"response_length\": {\"option\": \"moderate\"}, \"search_confidence\": {\"threshold\": \"less_often\"}}, \"server_side_search\": {\"url\": \"url\", \"port\": \"port\", \"username\": \"username\", \"password\": \"password\", \"filter\": \"filter\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"apikey\": \"apikey\", \"no_auth\": true, \"auth_type\": \"basic\"}, \"client_side_search\": {\"filter\": \"filter\", \"metadata\": {\"anyKey\": \"anyValue\"}}}, \"warnings\": [{\"code\": \"code\", \"path\": \"path\", \"message\": \"message\"}], \"language\": \"language\", \"type\": \"action\"}], \"assistant_state\": {\"action_disabled\": true, \"dialog_disabled\": true}}"; String exportSkillsPath = "/v2/assistants/testString/skills_export"; server.enqueue( new MockResponse() @@ -1783,12 +2952,73 @@ public void testImportSkillsWOptions() throws Throwable { .title("testString") .build(); + // Construct an instance of the SearchSettingsElasticSearch model + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + + // Construct an instance of the SearchSettingsConversationalSearchResponseLength model + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + + // Construct an instance of the SearchSettingsConversationalSearchSearchConfidence model + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + + // Construct an instance of the SearchSettingsConversationalSearch model + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + + // Construct an instance of the SearchSettingsServerSideSearch model + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + + // Construct an instance of the SearchSettingsClientSideSearch model + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + // Construct an instance of the SearchSettings model SearchSettings searchSettingsModel = new SearchSettings.Builder() .discovery(searchSettingsDiscoveryModel) .messages(searchSettingsMessagesModel) .schemaMapping(searchSettingsSchemaMappingModel) + .elasticSearch(searchSettingsElasticSearchModel) + .conversationalSearch(searchSettingsConversationalSearchModel) + .serverSideSearch(searchSettingsServerSideSearchModel) + .clientSideSearch(searchSettingsClientSideSearchModel) .build(); // Construct an instance of the SkillImport model diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestrationTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestrationTest.java index c8616a8484d..ee3e0eeb935 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestrationTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentOrchestrationTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -31,14 +31,7 @@ public class BaseEnvironmentOrchestrationTest { @Test public void testBaseEnvironmentOrchestration() throws Throwable { BaseEnvironmentOrchestration baseEnvironmentOrchestrationModel = - new BaseEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); - assertEquals(baseEnvironmentOrchestrationModel.searchSkillFallback(), Boolean.valueOf(true)); - - String json = TestUtilities.serialize(baseEnvironmentOrchestrationModel); - - BaseEnvironmentOrchestration baseEnvironmentOrchestrationModelNew = - TestUtilities.deserialize(json, BaseEnvironmentOrchestration.class); - assertTrue(baseEnvironmentOrchestrationModelNew instanceof BaseEnvironmentOrchestration); - assertEquals(baseEnvironmentOrchestrationModelNew.searchSkillFallback(), Boolean.valueOf(true)); + new BaseEnvironmentOrchestration(); + assertNull(baseEnvironmentOrchestrationModel.isSearchSkillFallback()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReferenceTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReferenceTest.java index 62c0be7abb6..e38bd36b50f 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReferenceTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/BaseEnvironmentReleaseReferenceTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -31,14 +31,7 @@ public class BaseEnvironmentReleaseReferenceTest { @Test public void testBaseEnvironmentReleaseReference() throws Throwable { BaseEnvironmentReleaseReference baseEnvironmentReleaseReferenceModel = - new BaseEnvironmentReleaseReference.Builder().release("testString").build(); - assertEquals(baseEnvironmentReleaseReferenceModel.release(), "testString"); - - String json = TestUtilities.serialize(baseEnvironmentReleaseReferenceModel); - - BaseEnvironmentReleaseReference baseEnvironmentReleaseReferenceModelNew = - TestUtilities.deserialize(json, BaseEnvironmentReleaseReference.class); - assertTrue(baseEnvironmentReleaseReferenceModelNew instanceof BaseEnvironmentReleaseReference); - assertEquals(baseEnvironmentReleaseReferenceModelNew.release(), "testString"); + new BaseEnvironmentReleaseReference(); + assertNull(baseEnvironmentReleaseReferenceModel.getRelease()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CompleteItemTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CompleteItemTest.java new file mode 100644 index 00000000000..54c64f22e82 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CompleteItemTest.java @@ -0,0 +1,59 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the CompleteItem model. */ +public class CompleteItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCompleteItem() throws Throwable { + CompleteItem completeItemModel = new CompleteItem(); + assertNull(completeItemModel.responseType()); + assertNull(completeItemModel.text()); + assertNull(completeItemModel.channels()); + assertNull(completeItemModel.time()); + assertNull(completeItemModel.typing()); + assertNull(completeItemModel.source()); + assertNull(completeItemModel.title()); + assertNull(completeItemModel.description()); + assertNull(completeItemModel.altText()); + assertNull(completeItemModel.preference()); + assertNull(completeItemModel.options()); + assertNull(completeItemModel.messageToHumanAgent()); + assertNull(completeItemModel.agentAvailable()); + assertNull(completeItemModel.agentUnavailable()); + assertNull(completeItemModel.topic()); + assertNull(completeItemModel.suggestions()); + assertNull(completeItemModel.messageToUser()); + assertNull(completeItemModel.header()); + assertNull(completeItemModel.primaryResults()); + assertNull(completeItemModel.additionalResults()); + assertNull(completeItemModel.userDefined()); + assertNull(completeItemModel.channelOptions()); + assertNull(completeItemModel.imageUrl()); + assertNull(completeItemModel.getStreamingMetadata()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateAssistantReleaseImportResponseTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateAssistantReleaseImportResponseTest.java new file mode 100644 index 00000000000..692a000677f --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateAssistantReleaseImportResponseTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the CreateAssistantReleaseImportResponse model. */ +public class CreateAssistantReleaseImportResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateAssistantReleaseImportResponse() throws Throwable { + CreateAssistantReleaseImportResponse createAssistantReleaseImportResponseModel = + new CreateAssistantReleaseImportResponse(); + assertNull(createAssistantReleaseImportResponseModel.getSkillImpactInDraft()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateProviderOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateProviderOptionsTest.java new file mode 100644 index 00000000000..0f5361001e1 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateProviderOptionsTest.java @@ -0,0 +1,146 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the CreateProviderOptions model. */ +public class CreateProviderOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testCreateProviderOptions() throws Throwable { + ProviderSpecificationServersItem providerSpecificationServersItemModel = + new ProviderSpecificationServersItem.Builder().url("testString").build(); + assertEquals(providerSpecificationServersItemModel.url(), "testString"); + + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModel.username(), + providerAuthenticationTypeAndValueModel); + + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals(providerAuthenticationOAuth2FlowsModel.tokenUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.refreshUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.clientAuthType(), "Body"); + assertEquals(providerAuthenticationOAuth2FlowsModel.contentType(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.headerPrefix(), "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + assertEquals(providerAuthenticationOAuth2Model.preferredFlow(), "password"); + assertEquals(providerAuthenticationOAuth2Model.flows(), providerAuthenticationOAuth2FlowsModel); + + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.authenticationMethod(), "basic"); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.basic(), + providerSpecificationComponentsSecuritySchemesBasicModel); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.oauth2(), + providerAuthenticationOAuth2Model); + + ProviderSpecificationComponents providerSpecificationComponentsModel = + new ProviderSpecificationComponents.Builder() + .securitySchemes(providerSpecificationComponentsSecuritySchemesModel) + .build(); + assertEquals( + providerSpecificationComponentsModel.securitySchemes(), + providerSpecificationComponentsSecuritySchemesModel); + + ProviderSpecification providerSpecificationModel = + new ProviderSpecification.Builder() + .servers(java.util.Arrays.asList(providerSpecificationServersItemModel)) + .components(providerSpecificationComponentsModel) + .build(); + assertEquals( + providerSpecificationModel.servers(), + java.util.Arrays.asList(providerSpecificationServersItemModel)); + assertEquals(providerSpecificationModel.components(), providerSpecificationComponentsModel); + + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationModel = + new ProviderPrivateAuthenticationBearerFlow.Builder() + .token(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerPrivateAuthenticationModel.token(), providerAuthenticationTypeAndValueModel); + + ProviderPrivate providerPrivateModel = + new ProviderPrivate.Builder().authentication(providerPrivateAuthenticationModel).build(); + assertEquals(providerPrivateModel.authentication(), providerPrivateAuthenticationModel); + + CreateProviderOptions createProviderOptionsModel = + new CreateProviderOptions.Builder() + .providerId("testString") + .specification(providerSpecificationModel) + .xPrivate(providerPrivateModel) + .build(); + assertEquals(createProviderOptionsModel.providerId(), "testString"); + assertEquals(createProviderOptionsModel.specification(), providerSpecificationModel); + assertEquals(createProviderOptionsModel.xPrivate(), providerPrivateModel); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testCreateProviderOptionsError() throws Throwable { + new CreateProviderOptions.Builder().build(); + } +} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTrainingDataOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptionsTest.java similarity index 55% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTrainingDataOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptionsTest.java index 41345051a17..7c999e079ae 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTrainingDataOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,38 +11,38 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the DeleteTrainingDataOptions model. */ -public class DeleteTrainingDataOptionsTest { +/** Unit test class for the CreateReleaseExportOptions model. */ +public class CreateReleaseExportOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testDeleteTrainingDataOptions() throws Throwable { - DeleteTrainingDataOptions deleteTrainingDataOptionsModel = - new DeleteTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") + public void testCreateReleaseExportOptions() throws Throwable { + CreateReleaseExportOptions createReleaseExportOptionsModel = + new CreateReleaseExportOptions.Builder() + .assistantId("testString") + .release("testString") + .includeAudit(false) .build(); - assertEquals(deleteTrainingDataOptionsModel.environmentId(), "testString"); - assertEquals(deleteTrainingDataOptionsModel.collectionId(), "testString"); - assertEquals(deleteTrainingDataOptionsModel.queryId(), "testString"); + assertEquals(createReleaseExportOptionsModel.assistantId(), "testString"); + assertEquals(createReleaseExportOptionsModel.release(), "testString"); + assertEquals(createReleaseExportOptionsModel.includeAudit(), Boolean.valueOf(false)); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteTrainingDataOptionsError() throws Throwable { - new DeleteTrainingDataOptions.Builder().build(); + public void testCreateReleaseExportOptionsError() throws Throwable { + new CreateReleaseExportOptions.Builder().build(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AggregationResultTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportWithStatusErrorsTest.java similarity index 67% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/AggregationResultTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportWithStatusErrorsTest.java index efdc950afa3..c92d47417f2 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AggregationResultTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseExportWithStatusErrorsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,27 +11,26 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the AggregationResult model. */ -public class AggregationResultTest { +/** Unit test class for the CreateReleaseExportWithStatusErrors model. */ +public class CreateReleaseExportWithStatusErrorsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testAggregationResult() throws Throwable { - AggregationResult aggregationResultModel = new AggregationResult(); - assertNull(aggregationResultModel.getKey()); - assertNull(aggregationResultModel.getMatchingResults()); + public void testCreateReleaseExportWithStatusErrors() throws Throwable { + CreateReleaseExportWithStatusErrors createReleaseExportWithStatusErrorsModel = + new CreateReleaseExportWithStatusErrors(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateStopwordListOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptionsTest.java similarity index 53% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateStopwordListOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptionsTest.java index cbf77840724..0af03867ffc 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateStopwordListOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/CreateReleaseImportOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,43 +11,41 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.apache.commons.io.IOUtils; import org.testng.annotations.Test; -/** Unit test class for the CreateStopwordListOptions model. */ -public class CreateStopwordListOptionsTest { +/** Unit test class for the CreateReleaseImportOptions model. */ +public class CreateReleaseImportOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCreateStopwordListOptions() throws Throwable { - CreateStopwordListOptions createStopwordListOptionsModel = - new CreateStopwordListOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .stopwordFile(TestUtilities.createMockStream("This is a mock file.")) - .stopwordFilename("testString") + public void testCreateReleaseImportOptions() throws Throwable { + CreateReleaseImportOptions createReleaseImportOptionsModel = + new CreateReleaseImportOptions.Builder() + .assistantId("testString") + .body(TestUtilities.createMockStream("This is a mock file.")) + .includeAudit(false) .build(); - assertEquals(createStopwordListOptionsModel.environmentId(), "testString"); - assertEquals(createStopwordListOptionsModel.collectionId(), "testString"); + assertEquals(createReleaseImportOptionsModel.assistantId(), "testString"); assertEquals( - IOUtils.toString(createStopwordListOptionsModel.stopwordFile()), + IOUtils.toString(createReleaseImportOptionsModel.body()), IOUtils.toString(TestUtilities.createMockStream("This is a mock file."))); - assertEquals(createStopwordListOptionsModel.stopwordFilename(), "testString"); + assertEquals(createReleaseImportOptionsModel.includeAudit(), Boolean.valueOf(false)); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateStopwordListOptionsError() throws Throwable { - new CreateStopwordListOptions.Builder().build(); + public void testCreateReleaseImportOptionsError() throws Throwable { + new CreateReleaseImportOptions.Builder().build(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteAllTrainingDataOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptionsTest.java similarity index 54% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteAllTrainingDataOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptionsTest.java index 39e24cfd3db..2cfaf56597d 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteAllTrainingDataOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/DownloadReleaseExportOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,36 +11,38 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the DeleteAllTrainingDataOptions model. */ -public class DeleteAllTrainingDataOptionsTest { +/** Unit test class for the DownloadReleaseExportOptions model. */ +public class DownloadReleaseExportOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testDeleteAllTrainingDataOptions() throws Throwable { - DeleteAllTrainingDataOptions deleteAllTrainingDataOptionsModel = - new DeleteAllTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") + public void testDownloadReleaseExportOptions() throws Throwable { + DownloadReleaseExportOptions downloadReleaseExportOptionsModel = + new DownloadReleaseExportOptions.Builder() + .assistantId("testString") + .release("testString") + .includeAudit(false) .build(); - assertEquals(deleteAllTrainingDataOptionsModel.environmentId(), "testString"); - assertEquals(deleteAllTrainingDataOptionsModel.collectionId(), "testString"); + assertEquals(downloadReleaseExportOptionsModel.assistantId(), "testString"); + assertEquals(downloadReleaseExportOptionsModel.release(), "testString"); + assertEquals(downloadReleaseExportOptionsModel.includeAudit(), Boolean.valueOf(false)); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteAllTrainingDataOptionsError() throws Throwable { - new DeleteAllTrainingDataOptions.Builder().build(); + public void testDownloadReleaseExportOptionsError() throws Throwable { + new DownloadReleaseExportOptions.Builder().build(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/FinalResponseOutputTest.java similarity index 54% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/FinalResponseOutputTest.java index 7d36e3dc9dc..3ee5e6f0ff4 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/FinalResponseOutputTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,34 +11,33 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the Collection model. */ -public class CollectionTest { +/** Unit test class for the FinalResponseOutput model. */ +public class FinalResponseOutputTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCollection() throws Throwable { - Collection collectionModel = new Collection(); - assertNull(collectionModel.getName()); - assertNull(collectionModel.getDescription()); - assertNull(collectionModel.getConfigurationId()); - assertNull(collectionModel.getLanguage()); - assertNull(collectionModel.getDocumentCounts()); - assertNull(collectionModel.getDiskUsage()); - assertNull(collectionModel.getTrainingStatus()); - assertNull(collectionModel.getCrawlStatus()); - assertNull(collectionModel.getSmartDocumentUnderstanding()); + public void testFinalResponseOutput() throws Throwable { + FinalResponseOutput finalResponseOutputModel = new FinalResponseOutput(); + assertNull(finalResponseOutputModel.getGeneric()); + assertNull(finalResponseOutputModel.getIntents()); + assertNull(finalResponseOutputModel.getEntities()); + assertNull(finalResponseOutputModel.getActions()); + assertNull(finalResponseOutputModel.getDebug()); + assertNull(finalResponseOutputModel.getUserDefined()); + assertNull(finalResponseOutputModel.getSpelling()); + assertNull(finalResponseOutputModel.getStreamingMetadata()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/FinalResponseTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/FinalResponseTest.java new file mode 100644 index 00000000000..25a7caaa201 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/FinalResponseTest.java @@ -0,0 +1,40 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the FinalResponse model. */ +public class FinalResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testFinalResponse() throws Throwable { + FinalResponse finalResponseModel = new FinalResponse(); + assertNull(finalResponseModel.getOutput()); + assertNull(finalResponseModel.getContext()); + assertNull(finalResponseModel.getUserId()); + assertNull(finalResponseModel.getMaskedOutput()); + assertNull(finalResponseModel.getMaskedInput()); + } +} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetStopwordListStatusOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptionsTest.java similarity index 57% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetStopwordListStatusOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptionsTest.java index e3f9455c1eb..12c843ba57b 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetStopwordListStatusOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/GetReleaseImportStatusOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,36 +11,36 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the GetStopwordListStatusOptions model. */ -public class GetStopwordListStatusOptionsTest { +/** Unit test class for the GetReleaseImportStatusOptions model. */ +public class GetReleaseImportStatusOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testGetStopwordListStatusOptions() throws Throwable { - GetStopwordListStatusOptions getStopwordListStatusOptionsModel = - new GetStopwordListStatusOptions.Builder() - .environmentId("testString") - .collectionId("testString") + public void testGetReleaseImportStatusOptions() throws Throwable { + GetReleaseImportStatusOptions getReleaseImportStatusOptionsModel = + new GetReleaseImportStatusOptions.Builder() + .assistantId("testString") + .includeAudit(false) .build(); - assertEquals(getStopwordListStatusOptionsModel.environmentId(), "testString"); - assertEquals(getStopwordListStatusOptionsModel.collectionId(), "testString"); + assertEquals(getReleaseImportStatusOptionsModel.assistantId(), "testString"); + assertEquals(getReleaseImportStatusOptionsModel.includeAudit(), Boolean.valueOf(false)); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetStopwordListStatusOptionsError() throws Throwable { - new GetStopwordListStatusOptions.Builder().build(); + public void testGetReleaseImportStatusOptionsError() throws Throwable { + new GetReleaseImportStatusOptions.Builder().build(); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptionsTest.java index 97e7ad2953c..2ac8d5ed152 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ImportSkillsOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -81,15 +81,110 @@ public void testImportSkillsOptions() throws Throwable { assertEquals(searchSettingsSchemaMappingModel.body(), "testString"); assertEquals(searchSettingsSchemaMappingModel.title(), "testString"); + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + assertEquals(searchSettingsElasticSearchModel.url(), "testString"); + assertEquals(searchSettingsElasticSearchModel.port(), "testString"); + assertEquals(searchSettingsElasticSearchModel.username(), "testString"); + assertEquals(searchSettingsElasticSearchModel.password(), "testString"); + assertEquals(searchSettingsElasticSearchModel.index(), "testString"); + assertEquals(searchSettingsElasticSearchModel.filter(), java.util.Arrays.asList("testString")); + assertEquals( + searchSettingsElasticSearchModel.queryBody(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsElasticSearchModel.managedIndex(), "testString"); + assertEquals(searchSettingsElasticSearchModel.apikey(), "testString"); + + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + assertEquals(searchSettingsConversationalSearchResponseLengthModel.option(), "moderate"); + + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + assertEquals(searchSettingsConversationalSearchSearchConfidenceModel.threshold(), "less_often"); + + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + assertEquals(searchSettingsConversationalSearchModel.enabled(), Boolean.valueOf(true)); + assertEquals( + searchSettingsConversationalSearchModel.responseLength(), + searchSettingsConversationalSearchResponseLengthModel); + assertEquals( + searchSettingsConversationalSearchModel.searchConfidence(), + searchSettingsConversationalSearchSearchConfidenceModel); + + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + assertEquals(searchSettingsServerSideSearchModel.url(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.port(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.username(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.password(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsServerSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsServerSideSearchModel.apikey(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.noAuth(), Boolean.valueOf(true)); + assertEquals(searchSettingsServerSideSearchModel.authType(), "basic"); + + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(searchSettingsClientSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsClientSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + SearchSettings searchSettingsModel = new SearchSettings.Builder() .discovery(searchSettingsDiscoveryModel) .messages(searchSettingsMessagesModel) .schemaMapping(searchSettingsSchemaMappingModel) + .elasticSearch(searchSettingsElasticSearchModel) + .conversationalSearch(searchSettingsConversationalSearchModel) + .serverSideSearch(searchSettingsServerSideSearchModel) + .clientSideSearch(searchSettingsClientSideSearchModel) .build(); assertEquals(searchSettingsModel.discovery(), searchSettingsDiscoveryModel); assertEquals(searchSettingsModel.messages(), searchSettingsMessagesModel); assertEquals(searchSettingsModel.schemaMapping(), searchSettingsSchemaMappingModel); + assertEquals(searchSettingsModel.elasticSearch(), searchSettingsElasticSearchModel); + assertEquals( + searchSettingsModel.conversationalSearch(), searchSettingsConversationalSearchModel); + assertEquals(searchSettingsModel.serverSideSearch(), searchSettingsServerSideSearchModel); + assertEquals(searchSettingsModel.clientSideSearch(), searchSettingsClientSideSearchModel); SkillImport skillImportModel = new SkillImport.Builder() diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ListProvidersOptionsTest.java similarity index 51% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/ListProvidersOptionsTest.java index 4283c9a6d4a..80d68b43216 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ListProvidersOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,38 +11,37 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the CreateEnvironmentOptions model. */ -public class CreateEnvironmentOptionsTest { +/** Unit test class for the ListProvidersOptions model. */ +public class ListProvidersOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCreateEnvironmentOptions() throws Throwable { - CreateEnvironmentOptions createEnvironmentOptionsModel = - new CreateEnvironmentOptions.Builder() - .name("testString") - .description("testString") - .size("LT") + public void testListProvidersOptions() throws Throwable { + ListProvidersOptions listProvidersOptionsModel = + new ListProvidersOptions.Builder() + .pageLimit(Long.valueOf("100")) + .includeCount(false) + .sort("name") + .cursor("testString") + .includeAudit(false) .build(); - assertEquals(createEnvironmentOptionsModel.name(), "testString"); - assertEquals(createEnvironmentOptionsModel.description(), "testString"); - assertEquals(createEnvironmentOptionsModel.size(), "LT"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateEnvironmentOptionsError() throws Throwable { - new CreateEnvironmentOptions.Builder().build(); + assertEquals(listProvidersOptionsModel.pageLimit(), Long.valueOf("100")); + assertEquals(listProvidersOptionsModel.includeCount(), Boolean.valueOf(false)); + assertEquals(listProvidersOptionsModel.sort(), "name"); + assertEquals(listProvidersOptionsModel.cursor(), "testString"); + assertEquals(listProvidersOptionsModel.includeAudit(), Boolean.valueOf(false)); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java index 7ce5df01dac..1a409310be7 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageOptionsTest.java @@ -281,12 +281,14 @@ public void testMessageOptions() throws Throwable { MessageOptions messageOptionsModel = new MessageOptions.Builder() .assistantId("testString") + .environmentId("testString") .sessionId("testString") .input(messageInputModel) .context(messageContextModel) .userId("testString") .build(); assertEquals(messageOptionsModel.assistantId(), "testString"); + assertEquals(messageOptionsModel.environmentId(), "testString"); assertEquals(messageOptionsModel.sessionId(), "testString"); assertEquals(messageOptionsModel.input(), messageInputModel); assertEquals(messageOptionsModel.context(), messageContextModel); diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptionsTest.java index e4ddeb449a6..10a5b1d8f60 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStatelessOptionsTest.java @@ -294,11 +294,13 @@ public void testMessageStatelessOptions() throws Throwable { MessageStatelessOptions messageStatelessOptionsModel = new MessageStatelessOptions.Builder() .assistantId("testString") + .environmentId("testString") .input(statelessMessageInputModel) .context(statelessMessageContextModel) .userId("testString") .build(); assertEquals(messageStatelessOptionsModel.assistantId(), "testString"); + assertEquals(messageStatelessOptionsModel.environmentId(), "testString"); assertEquals(messageStatelessOptionsModel.input(), statelessMessageInputModel); assertEquals(messageStatelessOptionsModel.context(), statelessMessageContextModel); assertEquals(messageStatelessOptionsModel.userId(), "testString"); diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionUsageTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamMetadataTest.java similarity index 68% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionUsageTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamMetadataTest.java index 1e774a26a37..56506432e9a 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionUsageTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamMetadataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,25 +11,26 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the CollectionUsage model. */ -public class CollectionUsageTest { +/** Unit test class for the MessageStreamMetadata model. */ +public class MessageStreamMetadataTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCollectionUsage() throws Throwable { - CollectionUsage collectionUsageModel = new CollectionUsage(); + public void testMessageStreamMetadata() throws Throwable { + MessageStreamMetadata messageStreamMetadataModel = new MessageStreamMetadata(); + assertNull(messageStreamMetadataModel.getStreamingMetadata()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamOptionsTest.java new file mode 100644 index 00000000000..73eaf1cf4f9 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamOptionsTest.java @@ -0,0 +1,302 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the MessageStreamOptions model. */ +public class MessageStreamOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testMessageStreamOptions() throws Throwable { + RuntimeIntent runtimeIntentModel = + new RuntimeIntent.Builder() + .intent("testString") + .confidence(Double.valueOf("72.5")) + .skill("testString") + .build(); + assertEquals(runtimeIntentModel.intent(), "testString"); + assertEquals(runtimeIntentModel.confidence(), Double.valueOf("72.5")); + assertEquals(runtimeIntentModel.skill(), "testString"); + + CaptureGroup captureGroupModel = + new CaptureGroup.Builder() + .group("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .build(); + assertEquals(captureGroupModel.group(), "testString"); + assertEquals(captureGroupModel.location(), java.util.Arrays.asList(Long.valueOf("26"))); + + RuntimeEntityInterpretation runtimeEntityInterpretationModel = + new RuntimeEntityInterpretation.Builder() + .calendarType("testString") + .datetimeLink("testString") + .festival("testString") + .granularity("day") + .rangeLink("testString") + .rangeModifier("testString") + .relativeDay(Double.valueOf("72.5")) + .relativeMonth(Double.valueOf("72.5")) + .relativeWeek(Double.valueOf("72.5")) + .relativeWeekend(Double.valueOf("72.5")) + .relativeYear(Double.valueOf("72.5")) + .specificDay(Double.valueOf("72.5")) + .specificDayOfWeek("testString") + .specificMonth(Double.valueOf("72.5")) + .specificQuarter(Double.valueOf("72.5")) + .specificYear(Double.valueOf("72.5")) + .numericValue(Double.valueOf("72.5")) + .subtype("testString") + .partOfDay("testString") + .relativeHour(Double.valueOf("72.5")) + .relativeMinute(Double.valueOf("72.5")) + .relativeSecond(Double.valueOf("72.5")) + .specificHour(Double.valueOf("72.5")) + .specificMinute(Double.valueOf("72.5")) + .specificSecond(Double.valueOf("72.5")) + .timezone("testString") + .build(); + assertEquals(runtimeEntityInterpretationModel.calendarType(), "testString"); + assertEquals(runtimeEntityInterpretationModel.datetimeLink(), "testString"); + assertEquals(runtimeEntityInterpretationModel.festival(), "testString"); + assertEquals(runtimeEntityInterpretationModel.granularity(), "day"); + assertEquals(runtimeEntityInterpretationModel.rangeLink(), "testString"); + assertEquals(runtimeEntityInterpretationModel.rangeModifier(), "testString"); + assertEquals(runtimeEntityInterpretationModel.relativeDay(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeMonth(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeWeek(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeWeekend(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeYear(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificDay(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificDayOfWeek(), "testString"); + assertEquals(runtimeEntityInterpretationModel.specificMonth(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificQuarter(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificYear(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.numericValue(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.subtype(), "testString"); + assertEquals(runtimeEntityInterpretationModel.partOfDay(), "testString"); + assertEquals(runtimeEntityInterpretationModel.relativeHour(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeMinute(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeSecond(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificHour(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificMinute(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificSecond(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.timezone(), "testString"); + + RuntimeEntityAlternative runtimeEntityAlternativeModel = + new RuntimeEntityAlternative.Builder() + .value("testString") + .confidence(Double.valueOf("72.5")) + .build(); + assertEquals(runtimeEntityAlternativeModel.value(), "testString"); + assertEquals(runtimeEntityAlternativeModel.confidence(), Double.valueOf("72.5")); + + RuntimeEntityRole runtimeEntityRoleModel = + new RuntimeEntityRole.Builder().type("date_from").build(); + assertEquals(runtimeEntityRoleModel.type(), "date_from"); + + RuntimeEntity runtimeEntityModel = + new RuntimeEntity.Builder() + .entity("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .value("testString") + .confidence(Double.valueOf("72.5")) + .groups(java.util.Arrays.asList(captureGroupModel)) + .interpretation(runtimeEntityInterpretationModel) + .alternatives(java.util.Arrays.asList(runtimeEntityAlternativeModel)) + .role(runtimeEntityRoleModel) + .skill("testString") + .build(); + assertEquals(runtimeEntityModel.entity(), "testString"); + assertEquals(runtimeEntityModel.location(), java.util.Arrays.asList(Long.valueOf("26"))); + assertEquals(runtimeEntityModel.value(), "testString"); + assertEquals(runtimeEntityModel.confidence(), Double.valueOf("72.5")); + assertEquals(runtimeEntityModel.groups(), java.util.Arrays.asList(captureGroupModel)); + assertEquals(runtimeEntityModel.interpretation(), runtimeEntityInterpretationModel); + assertEquals( + runtimeEntityModel.alternatives(), java.util.Arrays.asList(runtimeEntityAlternativeModel)); + assertEquals(runtimeEntityModel.role(), runtimeEntityRoleModel); + assertEquals(runtimeEntityModel.skill(), "testString"); + + MessageInputAttachment messageInputAttachmentModel = + new MessageInputAttachment.Builder().url("testString").mediaType("testString").build(); + assertEquals(messageInputAttachmentModel.url(), "testString"); + assertEquals(messageInputAttachmentModel.mediaType(), "testString"); + + RequestAnalytics requestAnalyticsModel = + new RequestAnalytics.Builder() + .browser("testString") + .device("testString") + .pageUrl("testString") + .build(); + assertEquals(requestAnalyticsModel.browser(), "testString"); + assertEquals(requestAnalyticsModel.device(), "testString"); + assertEquals(requestAnalyticsModel.pageUrl(), "testString"); + + MessageInputOptionsSpelling messageInputOptionsSpellingModel = + new MessageInputOptionsSpelling.Builder().suggestions(true).autoCorrect(true).build(); + assertEquals(messageInputOptionsSpellingModel.suggestions(), Boolean.valueOf(true)); + assertEquals(messageInputOptionsSpellingModel.autoCorrect(), Boolean.valueOf(true)); + + MessageInputOptions messageInputOptionsModel = + new MessageInputOptions.Builder() + .restart(false) + .alternateIntents(false) + .asyncCallout(false) + .spelling(messageInputOptionsSpellingModel) + .debug(false) + .returnContext(false) + .export(false) + .build(); + assertEquals(messageInputOptionsModel.restart(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.alternateIntents(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.asyncCallout(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.spelling(), messageInputOptionsSpellingModel); + assertEquals(messageInputOptionsModel.debug(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.returnContext(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.export(), Boolean.valueOf(false)); + + MessageInput messageInputModel = + new MessageInput.Builder() + .messageType("text") + .text("testString") + .intents(java.util.Arrays.asList(runtimeIntentModel)) + .entities(java.util.Arrays.asList(runtimeEntityModel)) + .suggestionId("testString") + .attachments(java.util.Arrays.asList(messageInputAttachmentModel)) + .analytics(requestAnalyticsModel) + .options(messageInputOptionsModel) + .build(); + assertEquals(messageInputModel.messageType(), "text"); + assertEquals(messageInputModel.text(), "testString"); + assertEquals(messageInputModel.intents(), java.util.Arrays.asList(runtimeIntentModel)); + assertEquals(messageInputModel.entities(), java.util.Arrays.asList(runtimeEntityModel)); + assertEquals(messageInputModel.suggestionId(), "testString"); + assertEquals( + messageInputModel.attachments(), java.util.Arrays.asList(messageInputAttachmentModel)); + assertEquals(messageInputModel.analytics(), requestAnalyticsModel); + assertEquals(messageInputModel.options(), messageInputOptionsModel); + + MessageContextGlobalSystem messageContextGlobalSystemModel = + new MessageContextGlobalSystem.Builder() + .timezone("testString") + .userId("testString") + .turnCount(Long.valueOf("26")) + .locale("en-us") + .referenceTime("testString") + .sessionStartTime("testString") + .state("testString") + .skipUserInput(true) + .build(); + assertEquals(messageContextGlobalSystemModel.timezone(), "testString"); + assertEquals(messageContextGlobalSystemModel.userId(), "testString"); + assertEquals(messageContextGlobalSystemModel.turnCount(), Long.valueOf("26")); + assertEquals(messageContextGlobalSystemModel.locale(), "en-us"); + assertEquals(messageContextGlobalSystemModel.referenceTime(), "testString"); + assertEquals(messageContextGlobalSystemModel.sessionStartTime(), "testString"); + assertEquals(messageContextGlobalSystemModel.state(), "testString"); + assertEquals(messageContextGlobalSystemModel.skipUserInput(), Boolean.valueOf(true)); + + MessageContextGlobal messageContextGlobalModel = + new MessageContextGlobal.Builder().system(messageContextGlobalSystemModel).build(); + assertEquals(messageContextGlobalModel.system(), messageContextGlobalSystemModel); + + MessageContextSkillSystem messageContextSkillSystemModel = + new MessageContextSkillSystem.Builder() + .state("testString") + .add("foo", "testString") + .build(); + assertEquals(messageContextSkillSystemModel.getState(), "testString"); + assertEquals(messageContextSkillSystemModel.get("foo"), "testString"); + + MessageContextDialogSkill messageContextDialogSkillModel = + new MessageContextDialogSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .build(); + assertEquals( + messageContextDialogSkillModel.userDefined(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(messageContextDialogSkillModel.system(), messageContextSkillSystemModel); + + MessageContextActionSkill messageContextActionSkillModel = + new MessageContextActionSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .actionVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .skillVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals( + messageContextActionSkillModel.userDefined(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(messageContextActionSkillModel.system(), messageContextSkillSystemModel); + assertEquals( + messageContextActionSkillModel.actionVariables(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals( + messageContextActionSkillModel.skillVariables(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + + MessageContextSkills messageContextSkillsModel = + new MessageContextSkills.Builder() + .mainSkill(messageContextDialogSkillModel) + .actionsSkill(messageContextActionSkillModel) + .build(); + assertEquals(messageContextSkillsModel.mainSkill(), messageContextDialogSkillModel); + assertEquals(messageContextSkillsModel.actionsSkill(), messageContextActionSkillModel); + + MessageContext messageContextModel = + new MessageContext.Builder() + .global(messageContextGlobalModel) + .skills(messageContextSkillsModel) + .integrations(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(messageContextModel.global(), messageContextGlobalModel); + assertEquals(messageContextModel.skills(), messageContextSkillsModel); + assertEquals( + messageContextModel.integrations(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + + MessageStreamOptions messageStreamOptionsModel = + new MessageStreamOptions.Builder() + .assistantId("testString") + .environmentId("testString") + .sessionId("testString") + .input(messageInputModel) + .context(messageContextModel) + .userId("testString") + .build(); + assertEquals(messageStreamOptionsModel.assistantId(), "testString"); + assertEquals(messageStreamOptionsModel.environmentId(), "testString"); + assertEquals(messageStreamOptionsModel.sessionId(), "testString"); + assertEquals(messageStreamOptionsModel.input(), messageInputModel); + assertEquals(messageStreamOptionsModel.context(), messageContextModel); + assertEquals(messageStreamOptionsModel.userId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testMessageStreamOptionsError() throws Throwable { + new MessageStreamOptions.Builder().build(); + } +} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryAggregationTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamResponseTest.java similarity index 70% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryAggregationTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamResponseTest.java index 1618a0e836a..82c6eb113c8 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryAggregationTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamResponseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,27 +11,27 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the QueryAggregation model. */ -public class QueryAggregationTest { +/** Unit test class for the MessageStreamResponse model. */ +public class MessageStreamResponseTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); // TODO: Add tests for models that are abstract @Test - public void testQueryAggregation() throws Throwable { - QueryAggregation queryAggregationModel = new QueryAggregation(); - assertNotNull(queryAggregationModel); + public void testMessageStreamResponse() throws Throwable { + MessageStreamResponse messageStreamResponseModel = new MessageStreamResponse(); + assertNotNull(messageStreamResponseModel); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptionsTest.java new file mode 100644 index 00000000000..da8efce94dd --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MessageStreamStatelessOptionsTest.java @@ -0,0 +1,300 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the MessageStreamStatelessOptions model. */ +public class MessageStreamStatelessOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testMessageStreamStatelessOptions() throws Throwable { + RuntimeIntent runtimeIntentModel = + new RuntimeIntent.Builder() + .intent("testString") + .confidence(Double.valueOf("72.5")) + .skill("testString") + .build(); + assertEquals(runtimeIntentModel.intent(), "testString"); + assertEquals(runtimeIntentModel.confidence(), Double.valueOf("72.5")); + assertEquals(runtimeIntentModel.skill(), "testString"); + + CaptureGroup captureGroupModel = + new CaptureGroup.Builder() + .group("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .build(); + assertEquals(captureGroupModel.group(), "testString"); + assertEquals(captureGroupModel.location(), java.util.Arrays.asList(Long.valueOf("26"))); + + RuntimeEntityInterpretation runtimeEntityInterpretationModel = + new RuntimeEntityInterpretation.Builder() + .calendarType("testString") + .datetimeLink("testString") + .festival("testString") + .granularity("day") + .rangeLink("testString") + .rangeModifier("testString") + .relativeDay(Double.valueOf("72.5")) + .relativeMonth(Double.valueOf("72.5")) + .relativeWeek(Double.valueOf("72.5")) + .relativeWeekend(Double.valueOf("72.5")) + .relativeYear(Double.valueOf("72.5")) + .specificDay(Double.valueOf("72.5")) + .specificDayOfWeek("testString") + .specificMonth(Double.valueOf("72.5")) + .specificQuarter(Double.valueOf("72.5")) + .specificYear(Double.valueOf("72.5")) + .numericValue(Double.valueOf("72.5")) + .subtype("testString") + .partOfDay("testString") + .relativeHour(Double.valueOf("72.5")) + .relativeMinute(Double.valueOf("72.5")) + .relativeSecond(Double.valueOf("72.5")) + .specificHour(Double.valueOf("72.5")) + .specificMinute(Double.valueOf("72.5")) + .specificSecond(Double.valueOf("72.5")) + .timezone("testString") + .build(); + assertEquals(runtimeEntityInterpretationModel.calendarType(), "testString"); + assertEquals(runtimeEntityInterpretationModel.datetimeLink(), "testString"); + assertEquals(runtimeEntityInterpretationModel.festival(), "testString"); + assertEquals(runtimeEntityInterpretationModel.granularity(), "day"); + assertEquals(runtimeEntityInterpretationModel.rangeLink(), "testString"); + assertEquals(runtimeEntityInterpretationModel.rangeModifier(), "testString"); + assertEquals(runtimeEntityInterpretationModel.relativeDay(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeMonth(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeWeek(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeWeekend(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeYear(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificDay(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificDayOfWeek(), "testString"); + assertEquals(runtimeEntityInterpretationModel.specificMonth(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificQuarter(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificYear(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.numericValue(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.subtype(), "testString"); + assertEquals(runtimeEntityInterpretationModel.partOfDay(), "testString"); + assertEquals(runtimeEntityInterpretationModel.relativeHour(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeMinute(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.relativeSecond(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificHour(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificMinute(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.specificSecond(), Double.valueOf("72.5")); + assertEquals(runtimeEntityInterpretationModel.timezone(), "testString"); + + RuntimeEntityAlternative runtimeEntityAlternativeModel = + new RuntimeEntityAlternative.Builder() + .value("testString") + .confidence(Double.valueOf("72.5")) + .build(); + assertEquals(runtimeEntityAlternativeModel.value(), "testString"); + assertEquals(runtimeEntityAlternativeModel.confidence(), Double.valueOf("72.5")); + + RuntimeEntityRole runtimeEntityRoleModel = + new RuntimeEntityRole.Builder().type("date_from").build(); + assertEquals(runtimeEntityRoleModel.type(), "date_from"); + + RuntimeEntity runtimeEntityModel = + new RuntimeEntity.Builder() + .entity("testString") + .location(java.util.Arrays.asList(Long.valueOf("26"))) + .value("testString") + .confidence(Double.valueOf("72.5")) + .groups(java.util.Arrays.asList(captureGroupModel)) + .interpretation(runtimeEntityInterpretationModel) + .alternatives(java.util.Arrays.asList(runtimeEntityAlternativeModel)) + .role(runtimeEntityRoleModel) + .skill("testString") + .build(); + assertEquals(runtimeEntityModel.entity(), "testString"); + assertEquals(runtimeEntityModel.location(), java.util.Arrays.asList(Long.valueOf("26"))); + assertEquals(runtimeEntityModel.value(), "testString"); + assertEquals(runtimeEntityModel.confidence(), Double.valueOf("72.5")); + assertEquals(runtimeEntityModel.groups(), java.util.Arrays.asList(captureGroupModel)); + assertEquals(runtimeEntityModel.interpretation(), runtimeEntityInterpretationModel); + assertEquals( + runtimeEntityModel.alternatives(), java.util.Arrays.asList(runtimeEntityAlternativeModel)); + assertEquals(runtimeEntityModel.role(), runtimeEntityRoleModel); + assertEquals(runtimeEntityModel.skill(), "testString"); + + MessageInputAttachment messageInputAttachmentModel = + new MessageInputAttachment.Builder().url("testString").mediaType("testString").build(); + assertEquals(messageInputAttachmentModel.url(), "testString"); + assertEquals(messageInputAttachmentModel.mediaType(), "testString"); + + RequestAnalytics requestAnalyticsModel = + new RequestAnalytics.Builder() + .browser("testString") + .device("testString") + .pageUrl("testString") + .build(); + assertEquals(requestAnalyticsModel.browser(), "testString"); + assertEquals(requestAnalyticsModel.device(), "testString"); + assertEquals(requestAnalyticsModel.pageUrl(), "testString"); + + MessageInputOptionsSpelling messageInputOptionsSpellingModel = + new MessageInputOptionsSpelling.Builder().suggestions(true).autoCorrect(true).build(); + assertEquals(messageInputOptionsSpellingModel.suggestions(), Boolean.valueOf(true)); + assertEquals(messageInputOptionsSpellingModel.autoCorrect(), Boolean.valueOf(true)); + + MessageInputOptions messageInputOptionsModel = + new MessageInputOptions.Builder() + .restart(false) + .alternateIntents(false) + .asyncCallout(false) + .spelling(messageInputOptionsSpellingModel) + .debug(false) + .returnContext(false) + .export(false) + .build(); + assertEquals(messageInputOptionsModel.restart(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.alternateIntents(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.asyncCallout(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.spelling(), messageInputOptionsSpellingModel); + assertEquals(messageInputOptionsModel.debug(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.returnContext(), Boolean.valueOf(false)); + assertEquals(messageInputOptionsModel.export(), Boolean.valueOf(false)); + + MessageInput messageInputModel = + new MessageInput.Builder() + .messageType("text") + .text("testString") + .intents(java.util.Arrays.asList(runtimeIntentModel)) + .entities(java.util.Arrays.asList(runtimeEntityModel)) + .suggestionId("testString") + .attachments(java.util.Arrays.asList(messageInputAttachmentModel)) + .analytics(requestAnalyticsModel) + .options(messageInputOptionsModel) + .build(); + assertEquals(messageInputModel.messageType(), "text"); + assertEquals(messageInputModel.text(), "testString"); + assertEquals(messageInputModel.intents(), java.util.Arrays.asList(runtimeIntentModel)); + assertEquals(messageInputModel.entities(), java.util.Arrays.asList(runtimeEntityModel)); + assertEquals(messageInputModel.suggestionId(), "testString"); + assertEquals( + messageInputModel.attachments(), java.util.Arrays.asList(messageInputAttachmentModel)); + assertEquals(messageInputModel.analytics(), requestAnalyticsModel); + assertEquals(messageInputModel.options(), messageInputOptionsModel); + + MessageContextGlobalSystem messageContextGlobalSystemModel = + new MessageContextGlobalSystem.Builder() + .timezone("testString") + .userId("testString") + .turnCount(Long.valueOf("26")) + .locale("en-us") + .referenceTime("testString") + .sessionStartTime("testString") + .state("testString") + .skipUserInput(true) + .build(); + assertEquals(messageContextGlobalSystemModel.timezone(), "testString"); + assertEquals(messageContextGlobalSystemModel.userId(), "testString"); + assertEquals(messageContextGlobalSystemModel.turnCount(), Long.valueOf("26")); + assertEquals(messageContextGlobalSystemModel.locale(), "en-us"); + assertEquals(messageContextGlobalSystemModel.referenceTime(), "testString"); + assertEquals(messageContextGlobalSystemModel.sessionStartTime(), "testString"); + assertEquals(messageContextGlobalSystemModel.state(), "testString"); + assertEquals(messageContextGlobalSystemModel.skipUserInput(), Boolean.valueOf(true)); + + MessageContextGlobal messageContextGlobalModel = + new MessageContextGlobal.Builder().system(messageContextGlobalSystemModel).build(); + assertEquals(messageContextGlobalModel.system(), messageContextGlobalSystemModel); + + MessageContextSkillSystem messageContextSkillSystemModel = + new MessageContextSkillSystem.Builder() + .state("testString") + .add("foo", "testString") + .build(); + assertEquals(messageContextSkillSystemModel.getState(), "testString"); + assertEquals(messageContextSkillSystemModel.get("foo"), "testString"); + + MessageContextDialogSkill messageContextDialogSkillModel = + new MessageContextDialogSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .build(); + assertEquals( + messageContextDialogSkillModel.userDefined(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(messageContextDialogSkillModel.system(), messageContextSkillSystemModel); + + MessageContextActionSkill messageContextActionSkillModel = + new MessageContextActionSkill.Builder() + .userDefined(java.util.Collections.singletonMap("anyKey", "anyValue")) + .system(messageContextSkillSystemModel) + .actionVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .skillVariables(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals( + messageContextActionSkillModel.userDefined(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(messageContextActionSkillModel.system(), messageContextSkillSystemModel); + assertEquals( + messageContextActionSkillModel.actionVariables(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals( + messageContextActionSkillModel.skillVariables(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + + MessageContextSkills messageContextSkillsModel = + new MessageContextSkills.Builder() + .mainSkill(messageContextDialogSkillModel) + .actionsSkill(messageContextActionSkillModel) + .build(); + assertEquals(messageContextSkillsModel.mainSkill(), messageContextDialogSkillModel); + assertEquals(messageContextSkillsModel.actionsSkill(), messageContextActionSkillModel); + + MessageContext messageContextModel = + new MessageContext.Builder() + .global(messageContextGlobalModel) + .skills(messageContextSkillsModel) + .integrations(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(messageContextModel.global(), messageContextGlobalModel); + assertEquals(messageContextModel.skills(), messageContextSkillsModel); + assertEquals( + messageContextModel.integrations(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + + MessageStreamStatelessOptions messageStreamStatelessOptionsModel = + new MessageStreamStatelessOptions.Builder() + .assistantId("testString") + .environmentId("testString") + .input(messageInputModel) + .context(messageContextModel) + .userId("testString") + .build(); + assertEquals(messageStreamStatelessOptionsModel.assistantId(), "testString"); + assertEquals(messageStreamStatelessOptionsModel.environmentId(), "testString"); + assertEquals(messageStreamStatelessOptionsModel.input(), messageInputModel); + assertEquals(messageStreamStatelessOptionsModel.context(), messageContextModel); + assertEquals(messageStreamStatelessOptionsModel.userId(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testMessageStreamStatelessOptionsError() throws Throwable { + new MessageStreamStatelessOptions.Builder().build(); + } +} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentCountsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MetadataTest.java similarity index 74% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentCountsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/MetadataTest.java index 605524516ad..ce7b2124f2f 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentCountsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MetadataTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,25 +11,26 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the DocumentCounts model. */ -public class DocumentCountsTest { +/** Unit test class for the Metadata model. */ +public class MetadataTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testDocumentCounts() throws Throwable { - DocumentCounts documentCountsModel = new DocumentCounts(); + public void testMetadata() throws Throwable { + Metadata metadataModel = new Metadata(); + assertNull(metadataModel.getId()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCollectionResponseTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MonitorAssistantReleaseImportArtifactResponseTest.java similarity index 60% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCollectionResponseTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/MonitorAssistantReleaseImportArtifactResponseTest.java index eeb2269bfb1..42e54e1148a 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCollectionResponseTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/MonitorAssistantReleaseImportArtifactResponseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,27 +11,28 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the DeleteCollectionResponse model. */ -public class DeleteCollectionResponseTest { +/** Unit test class for the MonitorAssistantReleaseImportArtifactResponse model. */ +public class MonitorAssistantReleaseImportArtifactResponseTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testDeleteCollectionResponse() throws Throwable { - DeleteCollectionResponse deleteCollectionResponseModel = new DeleteCollectionResponse(); - assertNull(deleteCollectionResponseModel.getCollectionId()); - assertNull(deleteCollectionResponseModel.getStatus()); + public void testMonitorAssistantReleaseImportArtifactResponse() throws Throwable { + MonitorAssistantReleaseImportArtifactResponse + monitorAssistantReleaseImportArtifactResponseModel = + new MonitorAssistantReleaseImportArtifactResponse(); + assertNull(monitorAssistantReleaseImportArtifactResponseModel.getSkillImpactInDraft()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionCrawlStatusTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/PartialItemTest.java similarity index 67% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionCrawlStatusTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/PartialItemTest.java index ae741e6669c..7cf518c58e5 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionCrawlStatusTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/PartialItemTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,26 +11,28 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the CollectionCrawlStatus model. */ -public class CollectionCrawlStatusTest { +/** Unit test class for the PartialItem model. */ +public class PartialItemTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCollectionCrawlStatus() throws Throwable { - CollectionCrawlStatus collectionCrawlStatusModel = new CollectionCrawlStatus(); - assertNull(collectionCrawlStatusModel.getSourceCrawl()); + public void testPartialItem() throws Throwable { + PartialItem partialItemModel = new PartialItem(); + assertNull(partialItemModel.getResponseType()); + assertNull(partialItemModel.getText()); + assertNull(partialItemModel.getStreamingMetadata()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeTest.java new file mode 100644 index 00000000000..a63e14594e1 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeTest.java @@ -0,0 +1,121 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit test class for the + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode model. + */ +public class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode() + throws Throwable { + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .authorizationUrl("testString") + .redirectUri("testString") + .build(); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .tokenUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .refreshUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .clientAuthType(), + "Body"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .contentType(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .headerPrefix(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .authorizationUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel + .redirectUri(), + "testString"); + + String json = + TestUtilities.serialize( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModel); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew = + TestUtilities.deserialize( + json, + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode + .class); + assertTrue( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + instanceof + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCode); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .tokenUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .refreshUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .clientAuthType(), + "Body"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .contentType(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .headerPrefix(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .authorizationUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2AuthorizationCodeModelNew + .redirectUri(), + "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsTest.java new file mode 100644 index 00000000000..672b219b3d6 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsTest.java @@ -0,0 +1,103 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit test class for the + * ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials model. + */ +public class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials() + throws Throwable { + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + .Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .build(); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel + .tokenUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel + .refreshUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel + .clientAuthType(), + "Body"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel + .contentType(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel + .headerPrefix(), + "testString"); + + String json = + TestUtilities.serialize( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModel); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew = + TestUtilities.deserialize( + json, + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials + .class); + assertTrue( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew + instanceof + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentials); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew + .tokenUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew + .refreshUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew + .clientAuthType(), + "Body"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew + .contentType(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2ClientCredentialsModelNew + .headerPrefix(), + "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordTest.java new file mode 100644 index 00000000000..c49d5fa6fed --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordTest.java @@ -0,0 +1,108 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit test class for the ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + * model. + */ +public class ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password() + throws Throwable { + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel.tokenUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel.refreshUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel.clientAuthType(), + "Body"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel.contentType(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel.headerPrefix(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + String json = + TestUtilities.serialize( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModel); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew = + TestUtilities.deserialize( + json, ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.class); + assertTrue( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew + instanceof ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew.tokenUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew.refreshUrl(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew + .clientAuthType(), + "Body"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew.contentType(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew + .headerPrefix(), + "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsProviderAuthenticationOAuth2PasswordModelNew + .username() + .toString(), + providerAuthenticationOAuth2PasswordUsernameModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsTest.java new file mode 100644 index 00000000000..d9fe8a29795 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2FlowsTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderAuthenticationOAuth2Flows model. */ +public class ProviderAuthenticationOAuth2FlowsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testProviderAuthenticationOAuth2Flows() throws Throwable { + ProviderAuthenticationOAuth2Flows providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2Flows(); + assertNotNull(providerAuthenticationOAuth2FlowsModel); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2PasswordUsernameTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2PasswordUsernameTest.java new file mode 100644 index 00000000000..81e55d7ac9d --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2PasswordUsernameTest.java @@ -0,0 +1,52 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderAuthenticationOAuth2PasswordUsername model. */ +public class ProviderAuthenticationOAuth2PasswordUsernameTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderAuthenticationOAuth2PasswordUsername() throws Throwable { + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + String json = TestUtilities.serialize(providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2PasswordUsername + providerAuthenticationOAuth2PasswordUsernameModelNew = + TestUtilities.deserialize(json, ProviderAuthenticationOAuth2PasswordUsername.class); + assertTrue( + providerAuthenticationOAuth2PasswordUsernameModelNew + instanceof ProviderAuthenticationOAuth2PasswordUsername); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModelNew.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModelNew.value(), "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2Test.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2Test.java new file mode 100644 index 00000000000..92ade353bee --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationOAuth2Test.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderAuthenticationOAuth2 model. */ +public class ProviderAuthenticationOAuth2Test { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderAuthenticationOAuth2() throws Throwable { + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals(providerAuthenticationOAuth2FlowsModel.tokenUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.refreshUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.clientAuthType(), "Body"); + assertEquals(providerAuthenticationOAuth2FlowsModel.contentType(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.headerPrefix(), "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + assertEquals(providerAuthenticationOAuth2Model.preferredFlow(), "password"); + assertEquals(providerAuthenticationOAuth2Model.flows(), providerAuthenticationOAuth2FlowsModel); + + String json = TestUtilities.serialize(providerAuthenticationOAuth2Model); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2ModelNew = + TestUtilities.deserialize(json, ProviderAuthenticationOAuth2.class); + assertTrue(providerAuthenticationOAuth2ModelNew instanceof ProviderAuthenticationOAuth2); + assertEquals(providerAuthenticationOAuth2ModelNew.preferredFlow(), "password"); + assertEquals( + providerAuthenticationOAuth2ModelNew.flows().toString(), + providerAuthenticationOAuth2FlowsModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationTypeAndValueTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationTypeAndValueTest.java new file mode 100644 index 00000000000..2cc0fcea245 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderAuthenticationTypeAndValueTest.java @@ -0,0 +1,47 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderAuthenticationTypeAndValue model. */ +public class ProviderAuthenticationTypeAndValueTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderAuthenticationTypeAndValue() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + String json = TestUtilities.serialize(providerAuthenticationTypeAndValueModel); + + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModelNew = + TestUtilities.deserialize(json, ProviderAuthenticationTypeAndValue.class); + assertTrue( + providerAuthenticationTypeAndValueModelNew instanceof ProviderAuthenticationTypeAndValue); + assertEquals(providerAuthenticationTypeAndValueModelNew.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModelNew.value(), "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderCollectionTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderCollectionTest.java new file mode 100644 index 00000000000..b8706260de8 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderCollectionTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderCollection model. */ +public class ProviderCollectionTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderCollection() throws Throwable { + ProviderCollection providerCollectionModel = new ProviderCollection(); + assertNull(providerCollectionModel.getConversationalSkillProviders()); + assertNull(providerCollectionModel.getPagination()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBasicFlowTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBasicFlowTest.java new file mode 100644 index 00000000000..e7951c79a3f --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBasicFlowTest.java @@ -0,0 +1,57 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivateAuthenticationBasicFlow model. */ +public class ProviderPrivateAuthenticationBasicFlowTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderPrivateAuthenticationBasicFlow() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderPrivateAuthenticationBasicFlow providerPrivateAuthenticationBasicFlowModel = + new ProviderPrivateAuthenticationBasicFlow.Builder() + .password(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerPrivateAuthenticationBasicFlowModel.password(), + providerAuthenticationTypeAndValueModel); + + String json = TestUtilities.serialize(providerPrivateAuthenticationBasicFlowModel); + + ProviderPrivateAuthenticationBasicFlow providerPrivateAuthenticationBasicFlowModelNew = + TestUtilities.deserialize(json, ProviderPrivateAuthenticationBasicFlow.class); + assertTrue( + providerPrivateAuthenticationBasicFlowModelNew + instanceof ProviderPrivateAuthenticationBasicFlow); + assertEquals( + providerPrivateAuthenticationBasicFlowModelNew.password().toString(), + providerAuthenticationTypeAndValueModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBearerFlowTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBearerFlowTest.java new file mode 100644 index 00000000000..92861f6be11 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationBearerFlowTest.java @@ -0,0 +1,57 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivateAuthenticationBearerFlow model. */ +public class ProviderPrivateAuthenticationBearerFlowTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderPrivateAuthenticationBearerFlow() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationBearerFlowModel = + new ProviderPrivateAuthenticationBearerFlow.Builder() + .token(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerPrivateAuthenticationBearerFlowModel.token(), + providerAuthenticationTypeAndValueModel); + + String json = TestUtilities.serialize(providerPrivateAuthenticationBearerFlowModel); + + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationBearerFlowModelNew = + TestUtilities.deserialize(json, ProviderPrivateAuthenticationBearerFlow.class); + assertTrue( + providerPrivateAuthenticationBearerFlowModelNew + instanceof ProviderPrivateAuthenticationBearerFlow); + assertEquals( + providerPrivateAuthenticationBearerFlowModelNew.token().toString(), + providerAuthenticationTypeAndValueModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeTest.java new file mode 100644 index 00000000000..3f7fc712297 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeTest.java @@ -0,0 +1,106 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit test class for the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + * model. + */ +public +class ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void + testProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode() + throws Throwable { + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel = + new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .Builder() + .clientId("testString") + .clientSecret("testString") + .accessToken("testString") + .refreshToken("testString") + .authorizationCode("testString") + .build(); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel + .clientId(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel + .clientSecret(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel + .accessToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel + .refreshToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel + .authorizationCode(), + "testString"); + + String json = + TestUtilities.serialize( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModel); + + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew = + TestUtilities.deserialize( + json, + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode + .class); + assertTrue( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew + instanceof + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCode); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew + .clientId(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew + .clientSecret(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew + .accessToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew + .refreshToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2AuthorizationCodeModelNew + .authorizationCode(), + "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsTest.java new file mode 100644 index 00000000000..783e4f8655c --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsTest.java @@ -0,0 +1,97 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit test class for the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + * model. + */ +public +class ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void + testProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials() + throws Throwable { + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModel = + new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + .Builder() + .clientId("testString") + .clientSecret("testString") + .accessToken("testString") + .refreshToken("testString") + .build(); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModel + .clientId(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModel + .clientSecret(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModel + .accessToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModel + .refreshToken(), + "testString"); + + String json = + TestUtilities.serialize( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModel); + + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModelNew = + TestUtilities.deserialize( + json, + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials + .class); + assertTrue( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModelNew + instanceof + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentials); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModelNew + .clientId(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModelNew + .clientSecret(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModelNew + .accessToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2ClientCredentialsModelNew + .refreshToken(), + "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordTest.java new file mode 100644 index 00000000000..a3ad088b995 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordTest.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** + * Unit test class for the + * ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password model. + */ +public +class ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void + testProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password() + throws Throwable { + ProviderPrivateAuthenticationOAuth2PasswordPassword + providerPrivateAuthenticationOAuth2PasswordPasswordModel = + new ProviderPrivateAuthenticationOAuth2PasswordPassword.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModel.type(), "value"); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModel.value(), "testString"); + + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel = + new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .Builder() + .clientId("testString") + .clientSecret("testString") + .accessToken("testString") + .refreshToken("testString") + .password(providerPrivateAuthenticationOAuth2PasswordPasswordModel) + .build(); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel + .clientId(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel + .clientSecret(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel + .accessToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel + .refreshToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel + .password(), + providerPrivateAuthenticationOAuth2PasswordPasswordModel); + + String json = + TestUtilities.serialize( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModel); + + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew = + TestUtilities.deserialize( + json, + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .class); + assertTrue( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew + instanceof + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew + .clientId(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew + .clientSecret(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew + .accessToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew + .refreshToken(), + "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2PasswordModelNew + .password() + .toString(), + providerPrivateAuthenticationOAuth2PasswordPasswordModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsTest.java new file mode 100644 index 00000000000..2e1eb99b3f2 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowFlowsTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivateAuthenticationOAuth2FlowFlows model. */ +public class ProviderPrivateAuthenticationOAuth2FlowFlowsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testProviderPrivateAuthenticationOAuth2FlowFlows() throws Throwable { + ProviderPrivateAuthenticationOAuth2FlowFlows providerPrivateAuthenticationOAuth2FlowFlowsModel = + new ProviderPrivateAuthenticationOAuth2FlowFlows(); + assertNotNull(providerPrivateAuthenticationOAuth2FlowFlowsModel); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowTest.java new file mode 100644 index 00000000000..1d678e6da18 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2FlowTest.java @@ -0,0 +1,79 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivateAuthenticationOAuth2Flow model. */ +public class ProviderPrivateAuthenticationOAuth2FlowTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderPrivateAuthenticationOAuth2Flow() throws Throwable { + ProviderPrivateAuthenticationOAuth2PasswordPassword + providerPrivateAuthenticationOAuth2PasswordPasswordModel = + new ProviderPrivateAuthenticationOAuth2PasswordPassword.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModel.type(), "value"); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModel.value(), "testString"); + + ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + providerPrivateAuthenticationOAuth2FlowFlowsModel = + new ProviderPrivateAuthenticationOAuth2FlowFlowsProviderPrivateAuthenticationOAuth2Password + .Builder() + .clientId("testString") + .clientSecret("testString") + .accessToken("testString") + .refreshToken("testString") + .password(providerPrivateAuthenticationOAuth2PasswordPasswordModel) + .build(); + assertEquals(providerPrivateAuthenticationOAuth2FlowFlowsModel.clientId(), "testString"); + assertEquals(providerPrivateAuthenticationOAuth2FlowFlowsModel.clientSecret(), "testString"); + assertEquals(providerPrivateAuthenticationOAuth2FlowFlowsModel.accessToken(), "testString"); + assertEquals(providerPrivateAuthenticationOAuth2FlowFlowsModel.refreshToken(), "testString"); + assertEquals( + providerPrivateAuthenticationOAuth2FlowFlowsModel.password(), + providerPrivateAuthenticationOAuth2PasswordPasswordModel); + + ProviderPrivateAuthenticationOAuth2Flow providerPrivateAuthenticationOAuth2FlowModel = + new ProviderPrivateAuthenticationOAuth2Flow.Builder() + .flows(providerPrivateAuthenticationOAuth2FlowFlowsModel) + .build(); + assertEquals( + providerPrivateAuthenticationOAuth2FlowModel.flows(), + providerPrivateAuthenticationOAuth2FlowFlowsModel); + + String json = TestUtilities.serialize(providerPrivateAuthenticationOAuth2FlowModel); + + ProviderPrivateAuthenticationOAuth2Flow providerPrivateAuthenticationOAuth2FlowModelNew = + TestUtilities.deserialize(json, ProviderPrivateAuthenticationOAuth2Flow.class); + assertTrue( + providerPrivateAuthenticationOAuth2FlowModelNew + instanceof ProviderPrivateAuthenticationOAuth2Flow); + assertEquals( + providerPrivateAuthenticationOAuth2FlowModelNew.flows().toString(), + providerPrivateAuthenticationOAuth2FlowFlowsModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2PasswordPasswordTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2PasswordPasswordTest.java new file mode 100644 index 00000000000..1a955309be7 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationOAuth2PasswordPasswordTest.java @@ -0,0 +1,54 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivateAuthenticationOAuth2PasswordPassword model. */ +public class ProviderPrivateAuthenticationOAuth2PasswordPasswordTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderPrivateAuthenticationOAuth2PasswordPassword() throws Throwable { + ProviderPrivateAuthenticationOAuth2PasswordPassword + providerPrivateAuthenticationOAuth2PasswordPasswordModel = + new ProviderPrivateAuthenticationOAuth2PasswordPassword.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModel.type(), "value"); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModel.value(), "testString"); + + String json = TestUtilities.serialize(providerPrivateAuthenticationOAuth2PasswordPasswordModel); + + ProviderPrivateAuthenticationOAuth2PasswordPassword + providerPrivateAuthenticationOAuth2PasswordPasswordModelNew = + TestUtilities.deserialize( + json, ProviderPrivateAuthenticationOAuth2PasswordPassword.class); + assertTrue( + providerPrivateAuthenticationOAuth2PasswordPasswordModelNew + instanceof ProviderPrivateAuthenticationOAuth2PasswordPassword); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModelNew.type(), "value"); + assertEquals(providerPrivateAuthenticationOAuth2PasswordPasswordModelNew.value(), "testString"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationTest.java new file mode 100644 index 00000000000..1c3084e369a --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateAuthenticationTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivateAuthentication model. */ +public class ProviderPrivateAuthenticationTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testProviderPrivateAuthentication() throws Throwable { + ProviderPrivateAuthentication providerPrivateAuthenticationModel = + new ProviderPrivateAuthentication(); + assertNotNull(providerPrivateAuthenticationModel); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateTest.java new file mode 100644 index 00000000000..08a874f888c --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderPrivateTest.java @@ -0,0 +1,63 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderPrivate model. */ +public class ProviderPrivateTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderPrivate() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationModel = + new ProviderPrivateAuthenticationBearerFlow.Builder() + .token(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerPrivateAuthenticationModel.token(), providerAuthenticationTypeAndValueModel); + + ProviderPrivate providerPrivateModel = + new ProviderPrivate.Builder().authentication(providerPrivateAuthenticationModel).build(); + assertEquals(providerPrivateModel.authentication(), providerPrivateAuthenticationModel); + + String json = TestUtilities.serialize(providerPrivateModel); + + ProviderPrivate providerPrivateModelNew = + TestUtilities.deserialize(json, ProviderPrivate.class); + assertTrue(providerPrivateModelNew instanceof ProviderPrivate); + assertEquals( + providerPrivateModelNew.authentication().toString(), + providerPrivateAuthenticationModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testProviderPrivateError() throws Throwable { + new ProviderPrivate.Builder().build(); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesBasicTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesBasicTest.java new file mode 100644 index 00000000000..a5a8acbe5e5 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesBasicTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderResponseSpecificationComponentsSecuritySchemesBasic model. */ +public class ProviderResponseSpecificationComponentsSecuritySchemesBasicTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderResponseSpecificationComponentsSecuritySchemesBasic() throws Throwable { + ProviderResponseSpecificationComponentsSecuritySchemesBasic + providerResponseSpecificationComponentsSecuritySchemesBasicModel = + new ProviderResponseSpecificationComponentsSecuritySchemesBasic(); + assertNull(providerResponseSpecificationComponentsSecuritySchemesBasicModel.getUsername()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesTest.java new file mode 100644 index 00000000000..c9ef14807e6 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsSecuritySchemesTest.java @@ -0,0 +1,41 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderResponseSpecificationComponentsSecuritySchemes model. */ +public class ProviderResponseSpecificationComponentsSecuritySchemesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderResponseSpecificationComponentsSecuritySchemes() throws Throwable { + ProviderResponseSpecificationComponentsSecuritySchemes + providerResponseSpecificationComponentsSecuritySchemesModel = + new ProviderResponseSpecificationComponentsSecuritySchemes(); + assertNull( + providerResponseSpecificationComponentsSecuritySchemesModel.getAuthenticationMethod()); + assertNull(providerResponseSpecificationComponentsSecuritySchemesModel.getBasic()); + assertNull(providerResponseSpecificationComponentsSecuritySchemesModel.getOauth2()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsTest.java new file mode 100644 index 00000000000..18c45260c8c --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationComponentsTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderResponseSpecificationComponents model. */ +public class ProviderResponseSpecificationComponentsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderResponseSpecificationComponents() throws Throwable { + ProviderResponseSpecificationComponents providerResponseSpecificationComponentsModel = + new ProviderResponseSpecificationComponents(); + assertNull(providerResponseSpecificationComponentsModel.getSecuritySchemes()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationServersItemTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationServersItemTest.java new file mode 100644 index 00000000000..c790bd87e90 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationServersItemTest.java @@ -0,0 +1,37 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderResponseSpecificationServersItem model. */ +public class ProviderResponseSpecificationServersItemTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderResponseSpecificationServersItem() throws Throwable { + ProviderResponseSpecificationServersItem providerResponseSpecificationServersItemModel = + new ProviderResponseSpecificationServersItem(); + assertNull(providerResponseSpecificationServersItemModel.getUrl()); + } +} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationResultTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationTest.java similarity index 64% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationResultTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationTest.java index 7d9ba8d6243..90f4f0b6e39 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationResultTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseSpecificationTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,28 +11,28 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the QueryTopHitsAggregationResult model. */ -public class QueryTopHitsAggregationResultTest { +/** Unit test class for the ProviderResponseSpecification model. */ +public class ProviderResponseSpecificationTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testQueryTopHitsAggregationResult() throws Throwable { - QueryTopHitsAggregationResult queryTopHitsAggregationResultModel = - new QueryTopHitsAggregationResult(); - assertNull(queryTopHitsAggregationResultModel.getMatchingResults()); - assertNull(queryTopHitsAggregationResultModel.getHits()); + public void testProviderResponseSpecification() throws Throwable { + ProviderResponseSpecification providerResponseSpecificationModel = + new ProviderResponseSpecification(); + assertNull(providerResponseSpecificationModel.getServers()); + assertNull(providerResponseSpecificationModel.getComponents()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseTest.java similarity index 68% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseTest.java index 609abffe157..e3d04c50b3d 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderResponseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,27 +11,27 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the LogQueryResponse model. */ -public class LogQueryResponseTest { +/** Unit test class for the ProviderResponse model. */ +public class ProviderResponseTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testLogQueryResponse() throws Throwable { - LogQueryResponse logQueryResponseModel = new LogQueryResponse(); - assertNull(logQueryResponseModel.getMatchingResults()); - assertNull(logQueryResponseModel.getResults()); + public void testProviderResponse() throws Throwable { + ProviderResponse providerResponseModel = new ProviderResponse(); + assertNull(providerResponseModel.getProviderId()); + assertNull(providerResponseModel.getSpecification()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesBasicTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesBasicTest.java new file mode 100644 index 00000000000..76af442b234 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesBasicTest.java @@ -0,0 +1,60 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderSpecificationComponentsSecuritySchemesBasic model. */ +public class ProviderSpecificationComponentsSecuritySchemesBasicTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderSpecificationComponentsSecuritySchemesBasic() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModel.username(), + providerAuthenticationTypeAndValueModel); + + String json = TestUtilities.serialize(providerSpecificationComponentsSecuritySchemesBasicModel); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModelNew = + TestUtilities.deserialize( + json, ProviderSpecificationComponentsSecuritySchemesBasic.class); + assertTrue( + providerSpecificationComponentsSecuritySchemesBasicModelNew + instanceof ProviderSpecificationComponentsSecuritySchemesBasic); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModelNew.username().toString(), + providerAuthenticationTypeAndValueModel.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesTest.java new file mode 100644 index 00000000000..66ec8882305 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsSecuritySchemesTest.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderSpecificationComponentsSecuritySchemes model. */ +public class ProviderSpecificationComponentsSecuritySchemesTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderSpecificationComponentsSecuritySchemes() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModel.username(), + providerAuthenticationTypeAndValueModel); + + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals(providerAuthenticationOAuth2FlowsModel.tokenUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.refreshUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.clientAuthType(), "Body"); + assertEquals(providerAuthenticationOAuth2FlowsModel.contentType(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.headerPrefix(), "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + assertEquals(providerAuthenticationOAuth2Model.preferredFlow(), "password"); + assertEquals(providerAuthenticationOAuth2Model.flows(), providerAuthenticationOAuth2FlowsModel); + + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.authenticationMethod(), "basic"); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.basic(), + providerSpecificationComponentsSecuritySchemesBasicModel); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.oauth2(), + providerAuthenticationOAuth2Model); + + String json = TestUtilities.serialize(providerSpecificationComponentsSecuritySchemesModel); + + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModelNew = + TestUtilities.deserialize(json, ProviderSpecificationComponentsSecuritySchemes.class); + assertTrue( + providerSpecificationComponentsSecuritySchemesModelNew + instanceof ProviderSpecificationComponentsSecuritySchemes); + assertEquals( + providerSpecificationComponentsSecuritySchemesModelNew.authenticationMethod(), "basic"); + assertEquals( + providerSpecificationComponentsSecuritySchemesModelNew.basic().toString(), + providerSpecificationComponentsSecuritySchemesBasicModel.toString()); + assertEquals( + providerSpecificationComponentsSecuritySchemesModelNew.oauth2().toString(), + providerAuthenticationOAuth2Model.toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsTest.java new file mode 100644 index 00000000000..9aee2603a08 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationComponentsTest.java @@ -0,0 +1,115 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderSpecificationComponents model. */ +public class ProviderSpecificationComponentsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderSpecificationComponents() throws Throwable { + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModel.username(), + providerAuthenticationTypeAndValueModel); + + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals(providerAuthenticationOAuth2FlowsModel.tokenUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.refreshUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.clientAuthType(), "Body"); + assertEquals(providerAuthenticationOAuth2FlowsModel.contentType(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.headerPrefix(), "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + assertEquals(providerAuthenticationOAuth2Model.preferredFlow(), "password"); + assertEquals(providerAuthenticationOAuth2Model.flows(), providerAuthenticationOAuth2FlowsModel); + + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.authenticationMethod(), "basic"); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.basic(), + providerSpecificationComponentsSecuritySchemesBasicModel); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.oauth2(), + providerAuthenticationOAuth2Model); + + ProviderSpecificationComponents providerSpecificationComponentsModel = + new ProviderSpecificationComponents.Builder() + .securitySchemes(providerSpecificationComponentsSecuritySchemesModel) + .build(); + assertEquals( + providerSpecificationComponentsModel.securitySchemes(), + providerSpecificationComponentsSecuritySchemesModel); + + String json = TestUtilities.serialize(providerSpecificationComponentsModel); + + ProviderSpecificationComponents providerSpecificationComponentsModelNew = + TestUtilities.deserialize(json, ProviderSpecificationComponents.class); + assertTrue(providerSpecificationComponentsModelNew instanceof ProviderSpecificationComponents); + assertEquals( + providerSpecificationComponentsModelNew.securitySchemes().toString(), + providerSpecificationComponentsSecuritySchemesModel.toString()); + } +} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCredentialsOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationServersItemTest.java similarity index 51% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCredentialsOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationServersItemTest.java index d3fbbd93587..bd01d5005b8 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCredentialsOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationServersItemTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,32 +11,35 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the ListCredentialsOptions model. */ -public class ListCredentialsOptionsTest { +/** Unit test class for the ProviderSpecificationServersItem model. */ +public class ProviderSpecificationServersItemTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testListCredentialsOptions() throws Throwable { - ListCredentialsOptions listCredentialsOptionsModel = - new ListCredentialsOptions.Builder().environmentId("testString").build(); - assertEquals(listCredentialsOptionsModel.environmentId(), "testString"); - } + public void testProviderSpecificationServersItem() throws Throwable { + ProviderSpecificationServersItem providerSpecificationServersItemModel = + new ProviderSpecificationServersItem.Builder().url("testString").build(); + assertEquals(providerSpecificationServersItemModel.url(), "testString"); + + String json = TestUtilities.serialize(providerSpecificationServersItemModel); - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListCredentialsOptionsError() throws Throwable { - new ListCredentialsOptions.Builder().build(); + ProviderSpecificationServersItem providerSpecificationServersItemModelNew = + TestUtilities.deserialize(json, ProviderSpecificationServersItem.class); + assertTrue( + providerSpecificationServersItemModelNew instanceof ProviderSpecificationServersItem); + assertEquals(providerSpecificationServersItemModelNew.url(), "testString"); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationTest.java new file mode 100644 index 00000000000..7a44ab74403 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/ProviderSpecificationTest.java @@ -0,0 +1,134 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the ProviderSpecification model. */ +public class ProviderSpecificationTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testProviderSpecification() throws Throwable { + ProviderSpecificationServersItem providerSpecificationServersItemModel = + new ProviderSpecificationServersItem.Builder().url("testString").build(); + assertEquals(providerSpecificationServersItemModel.url(), "testString"); + + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModel.username(), + providerAuthenticationTypeAndValueModel); + + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals(providerAuthenticationOAuth2FlowsModel.tokenUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.refreshUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.clientAuthType(), "Body"); + assertEquals(providerAuthenticationOAuth2FlowsModel.contentType(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.headerPrefix(), "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + assertEquals(providerAuthenticationOAuth2Model.preferredFlow(), "password"); + assertEquals(providerAuthenticationOAuth2Model.flows(), providerAuthenticationOAuth2FlowsModel); + + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.authenticationMethod(), "basic"); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.basic(), + providerSpecificationComponentsSecuritySchemesBasicModel); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.oauth2(), + providerAuthenticationOAuth2Model); + + ProviderSpecificationComponents providerSpecificationComponentsModel = + new ProviderSpecificationComponents.Builder() + .securitySchemes(providerSpecificationComponentsSecuritySchemesModel) + .build(); + assertEquals( + providerSpecificationComponentsModel.securitySchemes(), + providerSpecificationComponentsSecuritySchemesModel); + + ProviderSpecification providerSpecificationModel = + new ProviderSpecification.Builder() + .servers(java.util.Arrays.asList(providerSpecificationServersItemModel)) + .components(providerSpecificationComponentsModel) + .build(); + assertEquals( + providerSpecificationModel.servers(), + java.util.Arrays.asList(providerSpecificationServersItemModel)); + assertEquals(providerSpecificationModel.components(), providerSpecificationComponentsModel); + + String json = TestUtilities.serialize(providerSpecificationModel); + + ProviderSpecification providerSpecificationModelNew = + TestUtilities.deserialize(json, ProviderSpecification.class); + assertTrue(providerSpecificationModelNew instanceof ProviderSpecification); + assertEquals( + providerSpecificationModelNew.components().toString(), + providerSpecificationComponentsModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testProviderSpecificationError() throws Throwable { + new ProviderSpecification.Builder().build(); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsClientSideSearchTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsClientSideSearchTest.java new file mode 100644 index 00000000000..af4a0e180a0 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsClientSideSearchTest.java @@ -0,0 +1,53 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the SearchSettingsClientSideSearch model. */ +public class SearchSettingsClientSideSearchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSearchSettingsClientSideSearch() throws Throwable { + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(searchSettingsClientSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsClientSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + + String json = TestUtilities.serialize(searchSettingsClientSideSearchModel); + + SearchSettingsClientSideSearch searchSettingsClientSideSearchModelNew = + TestUtilities.deserialize(json, SearchSettingsClientSideSearch.class); + assertTrue(searchSettingsClientSideSearchModelNew instanceof SearchSettingsClientSideSearch); + assertEquals(searchSettingsClientSideSearchModelNew.filter(), "testString"); + assertEquals( + searchSettingsClientSideSearchModelNew.metadata().toString(), + java.util.Collections.singletonMap("anyKey", "anyValue").toString()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchResponseLengthTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchResponseLengthTest.java new file mode 100644 index 00000000000..ebbd2b2d433 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchResponseLengthTest.java @@ -0,0 +1,50 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the SearchSettingsConversationalSearchResponseLength model. */ +public class SearchSettingsConversationalSearchResponseLengthTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSearchSettingsConversationalSearchResponseLength() throws Throwable { + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + assertEquals(searchSettingsConversationalSearchResponseLengthModel.option(), "moderate"); + + String json = TestUtilities.serialize(searchSettingsConversationalSearchResponseLengthModel); + + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModelNew = + TestUtilities.deserialize(json, SearchSettingsConversationalSearchResponseLength.class); + assertTrue( + searchSettingsConversationalSearchResponseLengthModelNew + instanceof SearchSettingsConversationalSearchResponseLength); + assertEquals(searchSettingsConversationalSearchResponseLengthModelNew.option(), "moderate"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchSearchConfidenceTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchSearchConfidenceTest.java new file mode 100644 index 00000000000..85008dc84f8 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchSearchConfidenceTest.java @@ -0,0 +1,52 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the SearchSettingsConversationalSearchSearchConfidence model. */ +public class SearchSettingsConversationalSearchSearchConfidenceTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSearchSettingsConversationalSearchSearchConfidence() throws Throwable { + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + assertEquals(searchSettingsConversationalSearchSearchConfidenceModel.threshold(), "less_often"); + + String json = TestUtilities.serialize(searchSettingsConversationalSearchSearchConfidenceModel); + + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModelNew = + TestUtilities.deserialize( + json, SearchSettingsConversationalSearchSearchConfidence.class); + assertTrue( + searchSettingsConversationalSearchSearchConfidenceModelNew + instanceof SearchSettingsConversationalSearchSearchConfidence); + assertEquals( + searchSettingsConversationalSearchSearchConfidenceModelNew.threshold(), "less_often"); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchTest.java new file mode 100644 index 00000000000..39a0d270eca --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsConversationalSearchTest.java @@ -0,0 +1,80 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the SearchSettingsConversationalSearch model. */ +public class SearchSettingsConversationalSearchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSearchSettingsConversationalSearch() throws Throwable { + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + assertEquals(searchSettingsConversationalSearchResponseLengthModel.option(), "moderate"); + + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + assertEquals(searchSettingsConversationalSearchSearchConfidenceModel.threshold(), "less_often"); + + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + assertEquals(searchSettingsConversationalSearchModel.enabled(), Boolean.valueOf(true)); + assertEquals( + searchSettingsConversationalSearchModel.responseLength(), + searchSettingsConversationalSearchResponseLengthModel); + assertEquals( + searchSettingsConversationalSearchModel.searchConfidence(), + searchSettingsConversationalSearchSearchConfidenceModel); + + String json = TestUtilities.serialize(searchSettingsConversationalSearchModel); + + SearchSettingsConversationalSearch searchSettingsConversationalSearchModelNew = + TestUtilities.deserialize(json, SearchSettingsConversationalSearch.class); + assertTrue( + searchSettingsConversationalSearchModelNew instanceof SearchSettingsConversationalSearch); + assertEquals(searchSettingsConversationalSearchModelNew.enabled(), Boolean.valueOf(true)); + assertEquals( + searchSettingsConversationalSearchModelNew.responseLength().toString(), + searchSettingsConversationalSearchResponseLengthModel.toString()); + assertEquals( + searchSettingsConversationalSearchModelNew.searchConfidence().toString(), + searchSettingsConversationalSearchSearchConfidenceModel.toString()); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testSearchSettingsConversationalSearchError() throws Throwable { + new SearchSettingsConversationalSearch.Builder().build(); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsElasticSearchTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsElasticSearchTest.java new file mode 100644 index 00000000000..a583f06e702 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsElasticSearchTest.java @@ -0,0 +1,78 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the SearchSettingsElasticSearch model. */ +public class SearchSettingsElasticSearchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSearchSettingsElasticSearch() throws Throwable { + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + assertEquals(searchSettingsElasticSearchModel.url(), "testString"); + assertEquals(searchSettingsElasticSearchModel.port(), "testString"); + assertEquals(searchSettingsElasticSearchModel.username(), "testString"); + assertEquals(searchSettingsElasticSearchModel.password(), "testString"); + assertEquals(searchSettingsElasticSearchModel.index(), "testString"); + assertEquals(searchSettingsElasticSearchModel.filter(), java.util.Arrays.asList("testString")); + assertEquals( + searchSettingsElasticSearchModel.queryBody(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsElasticSearchModel.managedIndex(), "testString"); + assertEquals(searchSettingsElasticSearchModel.apikey(), "testString"); + + String json = TestUtilities.serialize(searchSettingsElasticSearchModel); + + SearchSettingsElasticSearch searchSettingsElasticSearchModelNew = + TestUtilities.deserialize(json, SearchSettingsElasticSearch.class); + assertTrue(searchSettingsElasticSearchModelNew instanceof SearchSettingsElasticSearch); + assertEquals(searchSettingsElasticSearchModelNew.url(), "testString"); + assertEquals(searchSettingsElasticSearchModelNew.port(), "testString"); + assertEquals(searchSettingsElasticSearchModelNew.username(), "testString"); + assertEquals(searchSettingsElasticSearchModelNew.password(), "testString"); + assertEquals(searchSettingsElasticSearchModelNew.index(), "testString"); + assertEquals( + searchSettingsElasticSearchModelNew.queryBody().toString(), + java.util.Collections.singletonMap("anyKey", "anyValue").toString()); + assertEquals(searchSettingsElasticSearchModelNew.managedIndex(), "testString"); + assertEquals(searchSettingsElasticSearchModelNew.apikey(), "testString"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testSearchSettingsElasticSearchError() throws Throwable { + new SearchSettingsElasticSearch.Builder().build(); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsServerSideSearchTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsServerSideSearchTest.java new file mode 100644 index 00000000000..5863cd436c0 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsServerSideSearchTest.java @@ -0,0 +1,79 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the SearchSettingsServerSideSearch model. */ +public class SearchSettingsServerSideSearchTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testSearchSettingsServerSideSearch() throws Throwable { + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + assertEquals(searchSettingsServerSideSearchModel.url(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.port(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.username(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.password(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsServerSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsServerSideSearchModel.apikey(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.noAuth(), Boolean.valueOf(true)); + assertEquals(searchSettingsServerSideSearchModel.authType(), "basic"); + + String json = TestUtilities.serialize(searchSettingsServerSideSearchModel); + + SearchSettingsServerSideSearch searchSettingsServerSideSearchModelNew = + TestUtilities.deserialize(json, SearchSettingsServerSideSearch.class); + assertTrue(searchSettingsServerSideSearchModelNew instanceof SearchSettingsServerSideSearch); + assertEquals(searchSettingsServerSideSearchModelNew.url(), "testString"); + assertEquals(searchSettingsServerSideSearchModelNew.port(), "testString"); + assertEquals(searchSettingsServerSideSearchModelNew.username(), "testString"); + assertEquals(searchSettingsServerSideSearchModelNew.password(), "testString"); + assertEquals(searchSettingsServerSideSearchModelNew.filter(), "testString"); + assertEquals( + searchSettingsServerSideSearchModelNew.metadata().toString(), + java.util.Collections.singletonMap("anyKey", "anyValue").toString()); + assertEquals(searchSettingsServerSideSearchModelNew.apikey(), "testString"); + assertEquals(searchSettingsServerSideSearchModelNew.noAuth(), Boolean.valueOf(true)); + assertEquals(searchSettingsServerSideSearchModelNew.authType(), "basic"); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testSearchSettingsServerSideSearchError() throws Throwable { + new SearchSettingsServerSideSearch.Builder().build(); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsTest.java index c0c0ff305cf..f74c1dd992c 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SearchSettingsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -81,15 +81,110 @@ public void testSearchSettings() throws Throwable { assertEquals(searchSettingsSchemaMappingModel.body(), "testString"); assertEquals(searchSettingsSchemaMappingModel.title(), "testString"); + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + assertEquals(searchSettingsElasticSearchModel.url(), "testString"); + assertEquals(searchSettingsElasticSearchModel.port(), "testString"); + assertEquals(searchSettingsElasticSearchModel.username(), "testString"); + assertEquals(searchSettingsElasticSearchModel.password(), "testString"); + assertEquals(searchSettingsElasticSearchModel.index(), "testString"); + assertEquals(searchSettingsElasticSearchModel.filter(), java.util.Arrays.asList("testString")); + assertEquals( + searchSettingsElasticSearchModel.queryBody(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsElasticSearchModel.managedIndex(), "testString"); + assertEquals(searchSettingsElasticSearchModel.apikey(), "testString"); + + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + assertEquals(searchSettingsConversationalSearchResponseLengthModel.option(), "moderate"); + + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + assertEquals(searchSettingsConversationalSearchSearchConfidenceModel.threshold(), "less_often"); + + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + assertEquals(searchSettingsConversationalSearchModel.enabled(), Boolean.valueOf(true)); + assertEquals( + searchSettingsConversationalSearchModel.responseLength(), + searchSettingsConversationalSearchResponseLengthModel); + assertEquals( + searchSettingsConversationalSearchModel.searchConfidence(), + searchSettingsConversationalSearchSearchConfidenceModel); + + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + assertEquals(searchSettingsServerSideSearchModel.url(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.port(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.username(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.password(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsServerSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsServerSideSearchModel.apikey(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.noAuth(), Boolean.valueOf(true)); + assertEquals(searchSettingsServerSideSearchModel.authType(), "basic"); + + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(searchSettingsClientSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsClientSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + SearchSettings searchSettingsModel = new SearchSettings.Builder() .discovery(searchSettingsDiscoveryModel) .messages(searchSettingsMessagesModel) .schemaMapping(searchSettingsSchemaMappingModel) + .elasticSearch(searchSettingsElasticSearchModel) + .conversationalSearch(searchSettingsConversationalSearchModel) + .serverSideSearch(searchSettingsServerSideSearchModel) + .clientSideSearch(searchSettingsClientSideSearchModel) .build(); assertEquals(searchSettingsModel.discovery(), searchSettingsDiscoveryModel); assertEquals(searchSettingsModel.messages(), searchSettingsMessagesModel); assertEquals(searchSettingsModel.schemaMapping(), searchSettingsSchemaMappingModel); + assertEquals(searchSettingsModel.elasticSearch(), searchSettingsElasticSearchModel); + assertEquals( + searchSettingsModel.conversationalSearch(), searchSettingsConversationalSearchModel); + assertEquals(searchSettingsModel.serverSideSearch(), searchSettingsServerSideSearchModel); + assertEquals(searchSettingsModel.clientSideSearch(), searchSettingsClientSideSearchModel); String json = TestUtilities.serialize(searchSettingsModel); @@ -102,6 +197,18 @@ public void testSearchSettings() throws Throwable { assertEquals( searchSettingsModelNew.schemaMapping().toString(), searchSettingsSchemaMappingModel.toString()); + assertEquals( + searchSettingsModelNew.elasticSearch().toString(), + searchSettingsElasticSearchModel.toString()); + assertEquals( + searchSettingsModelNew.conversationalSearch().toString(), + searchSettingsConversationalSearchModel.toString()); + assertEquals( + searchSettingsModelNew.serverSideSearch().toString(), + searchSettingsServerSideSearchModel.toString()); + assertEquals( + searchSettingsModelNew.clientSideSearch().toString(), + searchSettingsClientSideSearchModel.toString()); } @Test(expectedExceptions = IllegalArgumentException.class) diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SkillImportTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SkillImportTest.java index 12f1d0970fb..6b1c12b14da 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SkillImportTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/SkillImportTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -81,15 +81,110 @@ public void testSkillImport() throws Throwable { assertEquals(searchSettingsSchemaMappingModel.body(), "testString"); assertEquals(searchSettingsSchemaMappingModel.title(), "testString"); + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + assertEquals(searchSettingsElasticSearchModel.url(), "testString"); + assertEquals(searchSettingsElasticSearchModel.port(), "testString"); + assertEquals(searchSettingsElasticSearchModel.username(), "testString"); + assertEquals(searchSettingsElasticSearchModel.password(), "testString"); + assertEquals(searchSettingsElasticSearchModel.index(), "testString"); + assertEquals(searchSettingsElasticSearchModel.filter(), java.util.Arrays.asList("testString")); + assertEquals( + searchSettingsElasticSearchModel.queryBody(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsElasticSearchModel.managedIndex(), "testString"); + assertEquals(searchSettingsElasticSearchModel.apikey(), "testString"); + + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + assertEquals(searchSettingsConversationalSearchResponseLengthModel.option(), "moderate"); + + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + assertEquals(searchSettingsConversationalSearchSearchConfidenceModel.threshold(), "less_often"); + + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + assertEquals(searchSettingsConversationalSearchModel.enabled(), Boolean.valueOf(true)); + assertEquals( + searchSettingsConversationalSearchModel.responseLength(), + searchSettingsConversationalSearchResponseLengthModel); + assertEquals( + searchSettingsConversationalSearchModel.searchConfidence(), + searchSettingsConversationalSearchSearchConfidenceModel); + + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + assertEquals(searchSettingsServerSideSearchModel.url(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.port(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.username(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.password(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsServerSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsServerSideSearchModel.apikey(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.noAuth(), Boolean.valueOf(true)); + assertEquals(searchSettingsServerSideSearchModel.authType(), "basic"); + + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(searchSettingsClientSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsClientSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + SearchSettings searchSettingsModel = new SearchSettings.Builder() .discovery(searchSettingsDiscoveryModel) .messages(searchSettingsMessagesModel) .schemaMapping(searchSettingsSchemaMappingModel) + .elasticSearch(searchSettingsElasticSearchModel) + .conversationalSearch(searchSettingsConversationalSearchModel) + .serverSideSearch(searchSettingsServerSideSearchModel) + .clientSideSearch(searchSettingsClientSideSearchModel) .build(); assertEquals(searchSettingsModel.discovery(), searchSettingsDiscoveryModel); assertEquals(searchSettingsModel.messages(), searchSettingsMessagesModel); assertEquals(searchSettingsModel.schemaMapping(), searchSettingsSchemaMappingModel); + assertEquals(searchSettingsModel.elasticSearch(), searchSettingsElasticSearchModel); + assertEquals( + searchSettingsModel.conversationalSearch(), searchSettingsConversationalSearchModel); + assertEquals(searchSettingsModel.serverSideSearch(), searchSettingsServerSideSearchModel); + assertEquals(searchSettingsModel.clientSideSearch(), searchSettingsClientSideSearchModel); SkillImport skillImportModel = new SkillImport.Builder() diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetTranslatedDocumentOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseOutputTest.java similarity index 51% rename from language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetTranslatedDocumentOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseOutputTest.java index ea72b80b9b5..8223a8edd06 100644 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetTranslatedDocumentOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseOutputTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,36 +11,34 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.language_translator.v3.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the GetTranslatedDocumentOptions model. */ -public class GetTranslatedDocumentOptionsTest { +/** Unit test class for the StatelessFinalResponseOutput model. */ +public class StatelessFinalResponseOutputTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testGetTranslatedDocumentOptions() throws Throwable { - GetTranslatedDocumentOptions getTranslatedDocumentOptionsModel = - new GetTranslatedDocumentOptions.Builder() - .documentId("testString") - .accept("application/powerpoint") - .build(); - assertEquals(getTranslatedDocumentOptionsModel.documentId(), "testString"); - assertEquals(getTranslatedDocumentOptionsModel.accept(), "application/powerpoint"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTranslatedDocumentOptionsError() throws Throwable { - new GetTranslatedDocumentOptions.Builder().build(); + public void testStatelessFinalResponseOutput() throws Throwable { + StatelessFinalResponseOutput statelessFinalResponseOutputModel = + new StatelessFinalResponseOutput(); + assertNull(statelessFinalResponseOutputModel.getGeneric()); + assertNull(statelessFinalResponseOutputModel.getIntents()); + assertNull(statelessFinalResponseOutputModel.getEntities()); + assertNull(statelessFinalResponseOutputModel.getActions()); + assertNull(statelessFinalResponseOutputModel.getDebug()); + assertNull(statelessFinalResponseOutputModel.getUserDefined()); + assertNull(statelessFinalResponseOutputModel.getSpelling()); + assertNull(statelessFinalResponseOutputModel.getStreamingMetadata()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseTest.java new file mode 100644 index 00000000000..beb4f048dd3 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessFinalResponseTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the StatelessFinalResponse model. */ +public class StatelessFinalResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testStatelessFinalResponse() throws Throwable { + StatelessFinalResponse statelessFinalResponseModel = new StatelessFinalResponse(); + assertNull(statelessFinalResponseModel.getOutput()); + assertNull(statelessFinalResponseModel.getContext()); + assertNull(statelessFinalResponseModel.getUserId()); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessMessageStreamResponseTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessMessageStreamResponseTest.java new file mode 100644 index 00000000000..36ffe5c04ac --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/StatelessMessageStreamResponseTest.java @@ -0,0 +1,38 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the StatelessMessageStreamResponse model. */ +public class StatelessMessageStreamResponseTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + // TODO: Add tests for models that are abstract + @Test + public void testStatelessMessageStreamResponse() throws Throwable { + StatelessMessageStreamResponse statelessMessageStreamResponseModel = + new StatelessMessageStreamResponse(); + assertNotNull(statelessMessageStreamResponseModel); + } +} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteDocumentOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutRequestTest.java similarity index 54% rename from language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteDocumentOptionsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutRequestTest.java index c96f25e1868..75f2663beed 100644 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteDocumentOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutRequestTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,32 +11,32 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.language_translator.v3.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the DeleteDocumentOptions model. */ -public class DeleteDocumentOptionsTest { +/** Unit test class for the TurnEventCalloutCalloutRequest model. */ +public class TurnEventCalloutCalloutRequestTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testDeleteDocumentOptions() throws Throwable { - DeleteDocumentOptions deleteDocumentOptionsModel = - new DeleteDocumentOptions.Builder().documentId("testString").build(); - assertEquals(deleteDocumentOptionsModel.documentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteDocumentOptionsError() throws Throwable { - new DeleteDocumentOptions.Builder().build(); + public void testTurnEventCalloutCalloutRequest() throws Throwable { + TurnEventCalloutCalloutRequest turnEventCalloutCalloutRequestModel = + new TurnEventCalloutCalloutRequest(); + assertNull(turnEventCalloutCalloutRequestModel.getMethod()); + assertNull(turnEventCalloutCalloutRequestModel.getUrl()); + assertNull(turnEventCalloutCalloutRequestModel.getPath()); + assertNull(turnEventCalloutCalloutRequestModel.getQueryParameters()); + assertNull(turnEventCalloutCalloutRequestModel.getHeaders()); + assertNull(turnEventCalloutCalloutRequestModel.getBody()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutResponseTest.java similarity index 61% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsTest.java rename to assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutResponseTest.java index eecaec4069d..38a517e21eb 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutResponseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,28 +11,29 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.assistant.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.assistant.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the LogQueryResponseResultDocuments model. */ -public class LogQueryResponseResultDocumentsTest { +/** Unit test class for the TurnEventCalloutCalloutResponse model. */ +public class TurnEventCalloutCalloutResponseTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testLogQueryResponseResultDocuments() throws Throwable { - LogQueryResponseResultDocuments logQueryResponseResultDocumentsModel = - new LogQueryResponseResultDocuments(); - assertNull(logQueryResponseResultDocumentsModel.getResults()); - assertNull(logQueryResponseResultDocumentsModel.getCount()); + public void testTurnEventCalloutCalloutResponse() throws Throwable { + TurnEventCalloutCalloutResponse turnEventCalloutCalloutResponseModel = + new TurnEventCalloutCalloutResponse(); + assertNull(turnEventCalloutCalloutResponseModel.getBody()); + assertNull(turnEventCalloutCalloutResponseModel.getStatusCode()); + assertNull(turnEventCalloutCalloutResponseModel.getLastEvent()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutTest.java index 76cfe5f1be5..647b33926ea 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/TurnEventCalloutCalloutTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -34,5 +34,7 @@ public void testTurnEventCalloutCallout() throws Throwable { assertNull(turnEventCalloutCalloutModel.getType()); assertNull(turnEventCalloutCalloutModel.getInternal()); assertNull(turnEventCalloutCalloutModel.getResultVariable()); + assertNull(turnEventCalloutCalloutModel.getRequest()); + assertNull(turnEventCalloutCalloutModel.getResponse()); } } diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java index baa8b66352a..e7e8316e9bf 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOptionsTest.java @@ -30,9 +30,9 @@ public class UpdateEnvironmentOptionsTest { @Test public void testUpdateEnvironmentOptions() throws Throwable { - BaseEnvironmentOrchestration baseEnvironmentOrchestrationModel = - new BaseEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); - assertEquals(baseEnvironmentOrchestrationModel.searchSkillFallback(), Boolean.valueOf(true)); + UpdateEnvironmentOrchestration updateEnvironmentOrchestrationModel = + new UpdateEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); + assertEquals(updateEnvironmentOrchestrationModel.searchSkillFallback(), Boolean.valueOf(true)); EnvironmentSkill environmentSkillModel = new EnvironmentSkill.Builder() @@ -54,7 +54,7 @@ public void testUpdateEnvironmentOptions() throws Throwable { .environmentId("testString") .name("testString") .description("testString") - .orchestration(baseEnvironmentOrchestrationModel) + .orchestration(updateEnvironmentOrchestrationModel) .sessionTimeout(Long.valueOf("10")) .skillReferences(java.util.Arrays.asList(environmentSkillModel)) .build(); @@ -62,7 +62,8 @@ public void testUpdateEnvironmentOptions() throws Throwable { assertEquals(updateEnvironmentOptionsModel.environmentId(), "testString"); assertEquals(updateEnvironmentOptionsModel.name(), "testString"); assertEquals(updateEnvironmentOptionsModel.description(), "testString"); - assertEquals(updateEnvironmentOptionsModel.orchestration(), baseEnvironmentOrchestrationModel); + assertEquals( + updateEnvironmentOptionsModel.orchestration(), updateEnvironmentOrchestrationModel); assertEquals(updateEnvironmentOptionsModel.sessionTimeout(), Long.valueOf("10")); assertEquals( updateEnvironmentOptionsModel.skillReferences(), diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOrchestrationTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOrchestrationTest.java new file mode 100644 index 00000000000..d51e8c76e71 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateEnvironmentOrchestrationTest.java @@ -0,0 +1,45 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the UpdateEnvironmentOrchestration model. */ +public class UpdateEnvironmentOrchestrationTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateEnvironmentOrchestration() throws Throwable { + UpdateEnvironmentOrchestration updateEnvironmentOrchestrationModel = + new UpdateEnvironmentOrchestration.Builder().searchSkillFallback(true).build(); + assertEquals(updateEnvironmentOrchestrationModel.searchSkillFallback(), Boolean.valueOf(true)); + + String json = TestUtilities.serialize(updateEnvironmentOrchestrationModel); + + UpdateEnvironmentOrchestration updateEnvironmentOrchestrationModelNew = + TestUtilities.deserialize(json, UpdateEnvironmentOrchestration.class); + assertTrue(updateEnvironmentOrchestrationModelNew instanceof UpdateEnvironmentOrchestration); + assertEquals( + updateEnvironmentOrchestrationModelNew.searchSkillFallback(), Boolean.valueOf(true)); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateProviderOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateProviderOptionsTest.java new file mode 100644 index 00000000000..f804b529c99 --- /dev/null +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateProviderOptionsTest.java @@ -0,0 +1,146 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.assistant.v2.model; + +import static org.testng.Assert.*; + +import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; +import com.ibm.watson.assistant.v2.utils.TestUtilities; +import java.io.InputStream; +import java.util.HashMap; +import java.util.List; +import org.testng.annotations.Test; + +/** Unit test class for the UpdateProviderOptions model. */ +public class UpdateProviderOptionsTest { + final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); + final List mockListFileWithMetadata = + TestUtilities.creatMockListFileWithMetadata(); + + @Test + public void testUpdateProviderOptions() throws Throwable { + ProviderSpecificationServersItem providerSpecificationServersItemModel = + new ProviderSpecificationServersItem.Builder().url("testString").build(); + assertEquals(providerSpecificationServersItemModel.url(), "testString"); + + ProviderAuthenticationTypeAndValue providerAuthenticationTypeAndValueModel = + new ProviderAuthenticationTypeAndValue.Builder().type("value").value("testString").build(); + assertEquals(providerAuthenticationTypeAndValueModel.type(), "value"); + assertEquals(providerAuthenticationTypeAndValueModel.value(), "testString"); + + ProviderSpecificationComponentsSecuritySchemesBasic + providerSpecificationComponentsSecuritySchemesBasicModel = + new ProviderSpecificationComponentsSecuritySchemesBasic.Builder() + .username(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesBasicModel.username(), + providerAuthenticationTypeAndValueModel); + + ProviderAuthenticationOAuth2PasswordUsername providerAuthenticationOAuth2PasswordUsernameModel = + new ProviderAuthenticationOAuth2PasswordUsername.Builder() + .type("value") + .value("testString") + .build(); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.type(), "value"); + assertEquals(providerAuthenticationOAuth2PasswordUsernameModel.value(), "testString"); + + ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password + providerAuthenticationOAuth2FlowsModel = + new ProviderAuthenticationOAuth2FlowsProviderAuthenticationOAuth2Password.Builder() + .tokenUrl("testString") + .refreshUrl("testString") + .clientAuthType("Body") + .contentType("testString") + .headerPrefix("testString") + .username(providerAuthenticationOAuth2PasswordUsernameModel) + .build(); + assertEquals(providerAuthenticationOAuth2FlowsModel.tokenUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.refreshUrl(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.clientAuthType(), "Body"); + assertEquals(providerAuthenticationOAuth2FlowsModel.contentType(), "testString"); + assertEquals(providerAuthenticationOAuth2FlowsModel.headerPrefix(), "testString"); + assertEquals( + providerAuthenticationOAuth2FlowsModel.username(), + providerAuthenticationOAuth2PasswordUsernameModel); + + ProviderAuthenticationOAuth2 providerAuthenticationOAuth2Model = + new ProviderAuthenticationOAuth2.Builder() + .preferredFlow("password") + .flows(providerAuthenticationOAuth2FlowsModel) + .build(); + assertEquals(providerAuthenticationOAuth2Model.preferredFlow(), "password"); + assertEquals(providerAuthenticationOAuth2Model.flows(), providerAuthenticationOAuth2FlowsModel); + + ProviderSpecificationComponentsSecuritySchemes + providerSpecificationComponentsSecuritySchemesModel = + new ProviderSpecificationComponentsSecuritySchemes.Builder() + .authenticationMethod("basic") + .basic(providerSpecificationComponentsSecuritySchemesBasicModel) + .oauth2(providerAuthenticationOAuth2Model) + .build(); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.authenticationMethod(), "basic"); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.basic(), + providerSpecificationComponentsSecuritySchemesBasicModel); + assertEquals( + providerSpecificationComponentsSecuritySchemesModel.oauth2(), + providerAuthenticationOAuth2Model); + + ProviderSpecificationComponents providerSpecificationComponentsModel = + new ProviderSpecificationComponents.Builder() + .securitySchemes(providerSpecificationComponentsSecuritySchemesModel) + .build(); + assertEquals( + providerSpecificationComponentsModel.securitySchemes(), + providerSpecificationComponentsSecuritySchemesModel); + + ProviderSpecification providerSpecificationModel = + new ProviderSpecification.Builder() + .servers(java.util.Arrays.asList(providerSpecificationServersItemModel)) + .components(providerSpecificationComponentsModel) + .build(); + assertEquals( + providerSpecificationModel.servers(), + java.util.Arrays.asList(providerSpecificationServersItemModel)); + assertEquals(providerSpecificationModel.components(), providerSpecificationComponentsModel); + + ProviderPrivateAuthenticationBearerFlow providerPrivateAuthenticationModel = + new ProviderPrivateAuthenticationBearerFlow.Builder() + .token(providerAuthenticationTypeAndValueModel) + .build(); + assertEquals( + providerPrivateAuthenticationModel.token(), providerAuthenticationTypeAndValueModel); + + ProviderPrivate providerPrivateModel = + new ProviderPrivate.Builder().authentication(providerPrivateAuthenticationModel).build(); + assertEquals(providerPrivateModel.authentication(), providerPrivateAuthenticationModel); + + UpdateProviderOptions updateProviderOptionsModel = + new UpdateProviderOptions.Builder() + .providerId("testString") + .specification(providerSpecificationModel) + .xPrivate(providerPrivateModel) + .build(); + assertEquals(updateProviderOptionsModel.providerId(), "testString"); + assertEquals(updateProviderOptionsModel.specification(), providerSpecificationModel); + assertEquals(updateProviderOptionsModel.xPrivate(), providerPrivateModel); + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testUpdateProviderOptionsError() throws Throwable { + new UpdateProviderOptions.Builder().build(); + } +} diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptionsTest.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptionsTest.java index 1c2756f687f..c2160d2bdcb 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptionsTest.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/model/UpdateSkillOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -81,15 +81,110 @@ public void testUpdateSkillOptions() throws Throwable { assertEquals(searchSettingsSchemaMappingModel.body(), "testString"); assertEquals(searchSettingsSchemaMappingModel.title(), "testString"); + SearchSettingsElasticSearch searchSettingsElasticSearchModel = + new SearchSettingsElasticSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .index("testString") + .filter(java.util.Arrays.asList("testString")) + .queryBody(java.util.Collections.singletonMap("anyKey", "anyValue")) + .managedIndex("testString") + .apikey("testString") + .build(); + assertEquals(searchSettingsElasticSearchModel.url(), "testString"); + assertEquals(searchSettingsElasticSearchModel.port(), "testString"); + assertEquals(searchSettingsElasticSearchModel.username(), "testString"); + assertEquals(searchSettingsElasticSearchModel.password(), "testString"); + assertEquals(searchSettingsElasticSearchModel.index(), "testString"); + assertEquals(searchSettingsElasticSearchModel.filter(), java.util.Arrays.asList("testString")); + assertEquals( + searchSettingsElasticSearchModel.queryBody(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsElasticSearchModel.managedIndex(), "testString"); + assertEquals(searchSettingsElasticSearchModel.apikey(), "testString"); + + SearchSettingsConversationalSearchResponseLength + searchSettingsConversationalSearchResponseLengthModel = + new SearchSettingsConversationalSearchResponseLength.Builder() + .option("moderate") + .build(); + assertEquals(searchSettingsConversationalSearchResponseLengthModel.option(), "moderate"); + + SearchSettingsConversationalSearchSearchConfidence + searchSettingsConversationalSearchSearchConfidenceModel = + new SearchSettingsConversationalSearchSearchConfidence.Builder() + .threshold("less_often") + .build(); + assertEquals(searchSettingsConversationalSearchSearchConfidenceModel.threshold(), "less_often"); + + SearchSettingsConversationalSearch searchSettingsConversationalSearchModel = + new SearchSettingsConversationalSearch.Builder() + .enabled(true) + .responseLength(searchSettingsConversationalSearchResponseLengthModel) + .searchConfidence(searchSettingsConversationalSearchSearchConfidenceModel) + .build(); + assertEquals(searchSettingsConversationalSearchModel.enabled(), Boolean.valueOf(true)); + assertEquals( + searchSettingsConversationalSearchModel.responseLength(), + searchSettingsConversationalSearchResponseLengthModel); + assertEquals( + searchSettingsConversationalSearchModel.searchConfidence(), + searchSettingsConversationalSearchSearchConfidenceModel); + + SearchSettingsServerSideSearch searchSettingsServerSideSearchModel = + new SearchSettingsServerSideSearch.Builder() + .url("testString") + .port("testString") + .username("testString") + .password("testString") + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .apikey("testString") + .noAuth(true) + .authType("basic") + .build(); + assertEquals(searchSettingsServerSideSearchModel.url(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.port(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.username(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.password(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsServerSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + assertEquals(searchSettingsServerSideSearchModel.apikey(), "testString"); + assertEquals(searchSettingsServerSideSearchModel.noAuth(), Boolean.valueOf(true)); + assertEquals(searchSettingsServerSideSearchModel.authType(), "basic"); + + SearchSettingsClientSideSearch searchSettingsClientSideSearchModel = + new SearchSettingsClientSideSearch.Builder() + .filter("testString") + .metadata(java.util.Collections.singletonMap("anyKey", "anyValue")) + .build(); + assertEquals(searchSettingsClientSideSearchModel.filter(), "testString"); + assertEquals( + searchSettingsClientSideSearchModel.metadata(), + java.util.Collections.singletonMap("anyKey", "anyValue")); + SearchSettings searchSettingsModel = new SearchSettings.Builder() .discovery(searchSettingsDiscoveryModel) .messages(searchSettingsMessagesModel) .schemaMapping(searchSettingsSchemaMappingModel) + .elasticSearch(searchSettingsElasticSearchModel) + .conversationalSearch(searchSettingsConversationalSearchModel) + .serverSideSearch(searchSettingsServerSideSearchModel) + .clientSideSearch(searchSettingsClientSideSearchModel) .build(); assertEquals(searchSettingsModel.discovery(), searchSettingsDiscoveryModel); assertEquals(searchSettingsModel.messages(), searchSettingsMessagesModel); assertEquals(searchSettingsModel.schemaMapping(), searchSettingsSchemaMappingModel); + assertEquals(searchSettingsModel.elasticSearch(), searchSettingsElasticSearchModel); + assertEquals( + searchSettingsModel.conversationalSearch(), searchSettingsConversationalSearchModel); + assertEquals(searchSettingsModel.serverSideSearch(), searchSettingsServerSideSearchModel); + assertEquals(searchSettingsModel.clientSideSearch(), searchSettingsClientSideSearchModel); UpdateSkillOptions updateSkillOptionsModel = new UpdateSkillOptions.Builder() diff --git a/assistant/src/test/java/com/ibm/watson/assistant/v2/utils/TestUtilities.java b/assistant/src/test/java/com/ibm/watson/assistant/v2/utils/TestUtilities.java index b1dd36beb43..e1ad03c5a14 100644 --- a/assistant/src/test/java/com/ibm/watson/assistant/v2/utils/TestUtilities.java +++ b/assistant/src/test/java/com/ibm/watson/assistant/v2/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.assistant.v2.utils; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -18,6 +19,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; +import java.util.Base64; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -114,8 +116,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception { diff --git a/common/src/test/java/com/ibm/watson/common/RetryRunner.java b/common/src/test/java/com/ibm/watson/common/RetryRunner.java index faf1cfd623a..bb6e734a080 100644 --- a/common/src/test/java/com/ibm/watson/common/RetryRunner.java +++ b/common/src/test/java/com/ibm/watson/common/RetryRunner.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -31,7 +31,7 @@ public class RetryRunner extends BlockJUnit4ClassRunner { private static final Logger LOG = Logger.getLogger(RetryRunner.class.getName()); - private static final int RETRY_COUNT = 3; + private static final int RETRY_COUNT = 0; /** Delay factor when tests are failing. */ private static final int RETRY_DELAY_FACTOR = 2000; diff --git a/discovery/README.md b/discovery/README.md index 32f9b9b236c..57c67082e82 100644 --- a/discovery/README.md +++ b/discovery/README.md @@ -20,23 +20,9 @@ ## Usage -This SDK supports both the Discovery v1 and v2 APIs. +This SDK supports the Discovery v2 APIs. -Otherwise, the APIs are fairly similar, offering the ability to manage collections of documents and query them for insights. You can learn more about the Discovery service [here](https://cloud.ibm.com/docs/discovery?topic=discovery-gs-api). - -### Using Discovery v1 - -```java -// Make sure to use the Discovery v1 import! -Authenticator authenticator = new IamAuthenticator(""); -Discovery discovery = new Discovery("2019-04-30", authenticator); - -//Build an empty query on an existing environment/collection -String environmentId = ""; -String collectionId = ""; -QueryOptions queryOptions = new QueryOptions.Builder(environmentId, collectionId).build(); -QueryResponse queryResponse = discovery.query(queryOptions).execute().getResult(); -``` +Otherwise, the APIs are fairly similar, offering the ability to manage collections of documents and query them for insights. You can learn more about the Discovery service [here](https://cloud.ibm.com/apidocs/discovery-data). ### Using Discovery v2 diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/Discovery.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/Discovery.java deleted file mode 100644 index f80bc008fad..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/Discovery.java +++ /dev/null @@ -1,2943 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -/* - * IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647 - */ - -package com.ibm.watson.discovery.v1; - -import com.google.gson.JsonObject; -import com.ibm.cloud.sdk.core.http.RequestBuilder; -import com.ibm.cloud.sdk.core.http.ResponseConverter; -import com.ibm.cloud.sdk.core.http.ServiceCall; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory; -import com.ibm.cloud.sdk.core.service.BaseService; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.cloud.sdk.core.util.RequestUtils; -import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; -import com.ibm.watson.common.SdkCommon; -import com.ibm.watson.discovery.v1.model.AddDocumentOptions; -import com.ibm.watson.discovery.v1.model.AddTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.Collection; -import com.ibm.watson.discovery.v1.model.Completions; -import com.ibm.watson.discovery.v1.model.Configuration; -import com.ibm.watson.discovery.v1.model.CreateCollectionOptions; -import com.ibm.watson.discovery.v1.model.CreateConfigurationOptions; -import com.ibm.watson.discovery.v1.model.CreateCredentialsOptions; -import com.ibm.watson.discovery.v1.model.CreateEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.CreateEventOptions; -import com.ibm.watson.discovery.v1.model.CreateEventResponse; -import com.ibm.watson.discovery.v1.model.CreateExpansionsOptions; -import com.ibm.watson.discovery.v1.model.CreateGatewayOptions; -import com.ibm.watson.discovery.v1.model.CreateStopwordListOptions; -import com.ibm.watson.discovery.v1.model.CreateTokenizationDictionaryOptions; -import com.ibm.watson.discovery.v1.model.CreateTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.Credentials; -import com.ibm.watson.discovery.v1.model.CredentialsList; -import com.ibm.watson.discovery.v1.model.DeleteAllTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.DeleteCollectionOptions; -import com.ibm.watson.discovery.v1.model.DeleteCollectionResponse; -import com.ibm.watson.discovery.v1.model.DeleteConfigurationOptions; -import com.ibm.watson.discovery.v1.model.DeleteConfigurationResponse; -import com.ibm.watson.discovery.v1.model.DeleteCredentials; -import com.ibm.watson.discovery.v1.model.DeleteCredentialsOptions; -import com.ibm.watson.discovery.v1.model.DeleteDocumentOptions; -import com.ibm.watson.discovery.v1.model.DeleteDocumentResponse; -import com.ibm.watson.discovery.v1.model.DeleteEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.DeleteEnvironmentResponse; -import com.ibm.watson.discovery.v1.model.DeleteExpansionsOptions; -import com.ibm.watson.discovery.v1.model.DeleteGatewayOptions; -import com.ibm.watson.discovery.v1.model.DeleteStopwordListOptions; -import com.ibm.watson.discovery.v1.model.DeleteTokenizationDictionaryOptions; -import com.ibm.watson.discovery.v1.model.DeleteTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.DeleteTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.DeleteUserDataOptions; -import com.ibm.watson.discovery.v1.model.DocumentAccepted; -import com.ibm.watson.discovery.v1.model.DocumentStatus; -import com.ibm.watson.discovery.v1.model.Environment; -import com.ibm.watson.discovery.v1.model.Expansions; -import com.ibm.watson.discovery.v1.model.FederatedQueryNoticesOptions; -import com.ibm.watson.discovery.v1.model.FederatedQueryOptions; -import com.ibm.watson.discovery.v1.model.Gateway; -import com.ibm.watson.discovery.v1.model.GatewayDelete; -import com.ibm.watson.discovery.v1.model.GatewayList; -import com.ibm.watson.discovery.v1.model.GetAutocompletionOptions; -import com.ibm.watson.discovery.v1.model.GetCollectionOptions; -import com.ibm.watson.discovery.v1.model.GetConfigurationOptions; -import com.ibm.watson.discovery.v1.model.GetCredentialsOptions; -import com.ibm.watson.discovery.v1.model.GetDocumentStatusOptions; -import com.ibm.watson.discovery.v1.model.GetEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.GetGatewayOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsEventRateOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryEventOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryNoResultsOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryTokenEventOptions; -import com.ibm.watson.discovery.v1.model.GetStopwordListStatusOptions; -import com.ibm.watson.discovery.v1.model.GetTokenizationDictionaryStatusOptions; -import com.ibm.watson.discovery.v1.model.GetTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.GetTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionFieldsOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionFieldsResponse; -import com.ibm.watson.discovery.v1.model.ListCollectionsOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionsResponse; -import com.ibm.watson.discovery.v1.model.ListConfigurationsOptions; -import com.ibm.watson.discovery.v1.model.ListConfigurationsResponse; -import com.ibm.watson.discovery.v1.model.ListCredentialsOptions; -import com.ibm.watson.discovery.v1.model.ListEnvironmentsOptions; -import com.ibm.watson.discovery.v1.model.ListEnvironmentsResponse; -import com.ibm.watson.discovery.v1.model.ListExpansionsOptions; -import com.ibm.watson.discovery.v1.model.ListFieldsOptions; -import com.ibm.watson.discovery.v1.model.ListGatewaysOptions; -import com.ibm.watson.discovery.v1.model.ListTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.ListTrainingExamplesOptions; -import com.ibm.watson.discovery.v1.model.LogQueryResponse; -import com.ibm.watson.discovery.v1.model.MetricResponse; -import com.ibm.watson.discovery.v1.model.MetricTokenResponse; -import com.ibm.watson.discovery.v1.model.QueryLogOptions; -import com.ibm.watson.discovery.v1.model.QueryNoticesOptions; -import com.ibm.watson.discovery.v1.model.QueryNoticesResponse; -import com.ibm.watson.discovery.v1.model.QueryOptions; -import com.ibm.watson.discovery.v1.model.QueryResponse; -import com.ibm.watson.discovery.v1.model.TokenDictStatusResponse; -import com.ibm.watson.discovery.v1.model.TrainingDataSet; -import com.ibm.watson.discovery.v1.model.TrainingExample; -import com.ibm.watson.discovery.v1.model.TrainingExampleList; -import com.ibm.watson.discovery.v1.model.TrainingQuery; -import com.ibm.watson.discovery.v1.model.UpdateCollectionOptions; -import com.ibm.watson.discovery.v1.model.UpdateConfigurationOptions; -import com.ibm.watson.discovery.v1.model.UpdateCredentialsOptions; -import com.ibm.watson.discovery.v1.model.UpdateDocumentOptions; -import com.ibm.watson.discovery.v1.model.UpdateEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.UpdateTrainingExampleOptions; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import okhttp3.MultipartBody; - -/** - * IBM Watson&trade; Discovery v1 is a cognitive search and content analytics engine that you - * can add to applications to identify patterns, trends and actionable insights to drive better - * decision-making. Securely unify structured and unstructured data with pre-enriched content, and - * use a simplified query language to eliminate the need for manual filtering of results. - * - *

API Version: 1.0 See: https://cloud.ibm.com/docs/discovery - */ -public class Discovery extends BaseService { - - /** Default service name used when configuring the `Discovery` client. */ - public static final String DEFAULT_SERVICE_NAME = "discovery"; - - /** Default service endpoint URL. */ - public static final String DEFAULT_SERVICE_URL = - "https://api.us-south.discovery.watson.cloud.ibm.com"; - - private String version; - - /** - * Constructs an instance of the `Discovery` client. The default service name is used to configure - * the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2019-04-30`. - */ - public Discovery(String version) { - this( - version, - DEFAULT_SERVICE_NAME, - ConfigBasedAuthenticatorFactory.getAuthenticator(DEFAULT_SERVICE_NAME)); - } - - /** - * Constructs an instance of the `Discovery` client. The default service name and specified - * authenticator are used to configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2019-04-30`. - * @param authenticator the {@link Authenticator} instance to be configured for this client - */ - public Discovery(String version, Authenticator authenticator) { - this(version, DEFAULT_SERVICE_NAME, authenticator); - } - - /** - * Constructs an instance of the `Discovery` client. The specified service name is used to - * configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2019-04-30`. - * @param serviceName the service name to be used when configuring the client instance - */ - public Discovery(String version, String serviceName) { - this(version, serviceName, ConfigBasedAuthenticatorFactory.getAuthenticator(serviceName)); - } - - /** - * Constructs an instance of the `Discovery` client. The specified service name and authenticator - * are used to configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2019-04-30`. - * @param serviceName the service name to be used when configuring the client instance - * @param authenticator the {@link Authenticator} instance to be configured for this client - */ - public Discovery(String version, String serviceName, Authenticator authenticator) { - super(serviceName, authenticator); - setServiceUrl(DEFAULT_SERVICE_URL); - setVersion(version); - this.configureService(serviceName); - } - - /** - * Gets the version. - * - *

Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. - * The current version is `2019-04-30`. - * - * @return the version - */ - public String getVersion() { - return this.version; - } - - /** - * Sets the version. - * - * @param version the new version - */ - public void setVersion(final String version) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(version, "version cannot be empty."); - this.version = version; - } - - /** - * Create an environment. - * - *

Creates a new environment for private data. An environment must be created before - * collections can be created. - * - *

**Note**: You can create only one environment for private data per service instance. An - * attempt to create another environment results in an error. - * - * @param createEnvironmentOptions the {@link CreateEnvironmentOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Environment} - */ - public ServiceCall createEnvironment( - CreateEnvironmentOptions createEnvironmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createEnvironmentOptions, "createEnvironmentOptions cannot be null"); - RequestBuilder builder = - RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/environments")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "createEnvironment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("name", createEnvironmentOptions.name()); - if (createEnvironmentOptions.description() != null) { - contentJson.addProperty("description", createEnvironmentOptions.description()); - } - if (createEnvironmentOptions.size() != null) { - contentJson.addProperty("size", createEnvironmentOptions.size()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List environments. - * - *

List existing environments for the service instance. - * - * @param listEnvironmentsOptions the {@link ListEnvironmentsOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link ListEnvironmentsResponse} - */ - public ServiceCall listEnvironments( - ListEnvironmentsOptions listEnvironmentsOptions) { - if (listEnvironmentsOptions == null) { - listEnvironmentsOptions = new ListEnvironmentsOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/environments")); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listEnvironments"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (listEnvironmentsOptions.name() != null) { - builder.query("name", String.valueOf(listEnvironmentsOptions.name())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List environments. - * - *

List existing environments for the service instance. - * - * @return a {@link ServiceCall} with a result of type {@link ListEnvironmentsResponse} - */ - public ServiceCall listEnvironments() { - return listEnvironments(null); - } - - /** - * Get environment info. - * - * @param getEnvironmentOptions the {@link GetEnvironmentOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link Environment} - */ - public ServiceCall getEnvironment(GetEnvironmentOptions getEnvironmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getEnvironmentOptions, "getEnvironmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getEnvironmentOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getEnvironment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update an environment. - * - *

Updates an environment. The environment's **name** and **description** parameters can be - * changed. You must specify a **name** for the environment. - * - * @param updateEnvironmentOptions the {@link UpdateEnvironmentOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Environment} - */ - public ServiceCall updateEnvironment( - UpdateEnvironmentOptions updateEnvironmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - updateEnvironmentOptions, "updateEnvironmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", updateEnvironmentOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.put( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "updateEnvironment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (updateEnvironmentOptions.name() != null) { - contentJson.addProperty("name", updateEnvironmentOptions.name()); - } - if (updateEnvironmentOptions.description() != null) { - contentJson.addProperty("description", updateEnvironmentOptions.description()); - } - if (updateEnvironmentOptions.size() != null) { - contentJson.addProperty("size", updateEnvironmentOptions.size()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete environment. - * - * @param deleteEnvironmentOptions the {@link DeleteEnvironmentOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link DeleteEnvironmentResponse} - */ - public ServiceCall deleteEnvironment( - DeleteEnvironmentOptions deleteEnvironmentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteEnvironmentOptions, "deleteEnvironmentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteEnvironmentOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteEnvironment"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List fields across collections. - * - *

Gets a list of the unique fields (and their types) stored in the indexes of the specified - * collections. - * - * @param listFieldsOptions the {@link ListFieldsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link ListCollectionFieldsResponse} - */ - public ServiceCall listFields(ListFieldsOptions listFieldsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listFieldsOptions, "listFieldsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listFieldsOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/fields", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listFields"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("collection_ids", RequestUtils.join(listFieldsOptions.collectionIds(), ",")); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Add configuration. - * - *

Creates a new configuration. - * - *

If the input configuration contains the **configuration_id**, **created**, or **updated** - * properties, then they are ignored and overridden by the system, and an error is not returned so - * that the overridden fields do not need to be removed when copying a configuration. - * - *

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do - * not generate an error. This makes it easier to use newer configuration files with older - * versions of the API and the service. It also makes it possible for the tooling to add - * additional metadata and information to the configuration. - * - * @param createConfigurationOptions the {@link CreateConfigurationOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link Configuration} - */ - public ServiceCall createConfiguration( - CreateConfigurationOptions createConfigurationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createConfigurationOptions, "createConfigurationOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createConfigurationOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/configurations", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "createConfiguration"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("name", createConfigurationOptions.name()); - if (createConfigurationOptions.description() != null) { - contentJson.addProperty("description", createConfigurationOptions.description()); - } - if (createConfigurationOptions.conversions() != null) { - contentJson.add( - "conversions", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createConfigurationOptions.conversions())); - } - if (createConfigurationOptions.enrichments() != null) { - contentJson.add( - "enrichments", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createConfigurationOptions.enrichments())); - } - if (createConfigurationOptions.normalizations() != null) { - contentJson.add( - "normalizations", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createConfigurationOptions.normalizations())); - } - if (createConfigurationOptions.source() != null) { - contentJson.add( - "source", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createConfigurationOptions.source())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List configurations. - * - *

Lists existing configurations for the service instance. - * - * @param listConfigurationsOptions the {@link ListConfigurationsOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link ListConfigurationsResponse} - */ - public ServiceCall listConfigurations( - ListConfigurationsOptions listConfigurationsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listConfigurationsOptions, "listConfigurationsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listConfigurationsOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/configurations", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "listConfigurations"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (listConfigurationsOptions.name() != null) { - builder.query("name", String.valueOf(listConfigurationsOptions.name())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get configuration details. - * - * @param getConfigurationOptions the {@link GetConfigurationOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Configuration} - */ - public ServiceCall getConfiguration( - GetConfigurationOptions getConfigurationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getConfigurationOptions, "getConfigurationOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getConfigurationOptions.environmentId()); - pathParamsMap.put("configuration_id", getConfigurationOptions.configurationId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/configurations/{configuration_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getConfiguration"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update a configuration. - * - *

Replaces an existing configuration. * Completely replaces the original configuration. * The - * **configuration_id**, **updated**, and **created** fields are accepted in the request, but they - * are ignored, and an error is not generated. It is also acceptable for users to submit an - * updated configuration with none of the three properties. * Documents are processed with a - * snapshot of the configuration as it was at the time the document was submitted to be ingested. - * This means that already submitted documents will not see any updates made to the configuration. - * - * @param updateConfigurationOptions the {@link UpdateConfigurationOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link Configuration} - */ - public ServiceCall updateConfiguration( - UpdateConfigurationOptions updateConfigurationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - updateConfigurationOptions, "updateConfigurationOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", updateConfigurationOptions.environmentId()); - pathParamsMap.put("configuration_id", updateConfigurationOptions.configurationId()); - RequestBuilder builder = - RequestBuilder.put( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/configurations/{configuration_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "updateConfiguration"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("name", updateConfigurationOptions.name()); - if (updateConfigurationOptions.description() != null) { - contentJson.addProperty("description", updateConfigurationOptions.description()); - } - if (updateConfigurationOptions.conversions() != null) { - contentJson.add( - "conversions", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(updateConfigurationOptions.conversions())); - } - if (updateConfigurationOptions.enrichments() != null) { - contentJson.add( - "enrichments", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(updateConfigurationOptions.enrichments())); - } - if (updateConfigurationOptions.normalizations() != null) { - contentJson.add( - "normalizations", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(updateConfigurationOptions.normalizations())); - } - if (updateConfigurationOptions.source() != null) { - contentJson.add( - "source", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(updateConfigurationOptions.source())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a configuration. - * - *

The deletion is performed unconditionally. A configuration deletion request succeeds even if - * the configuration is referenced by a collection or document ingestion. However, documents that - * have already been submitted for processing continue to use the deleted configuration. Documents - * are always processed with a snapshot of the configuration as it existed at the time the - * document was submitted. - * - * @param deleteConfigurationOptions the {@link DeleteConfigurationOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link DeleteConfigurationResponse} - */ - public ServiceCall deleteConfiguration( - DeleteConfigurationOptions deleteConfigurationOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteConfigurationOptions, "deleteConfigurationOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteConfigurationOptions.environmentId()); - pathParamsMap.put("configuration_id", deleteConfigurationOptions.configurationId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/configurations/{configuration_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteConfiguration"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create a collection. - * - * @param createCollectionOptions the {@link CreateCollectionOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Collection} - */ - public ServiceCall createCollection(CreateCollectionOptions createCollectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createCollectionOptions, "createCollectionOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createCollectionOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/collections", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "createCollection"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("name", createCollectionOptions.name()); - if (createCollectionOptions.description() != null) { - contentJson.addProperty("description", createCollectionOptions.description()); - } - if (createCollectionOptions.configurationId() != null) { - contentJson.addProperty("configuration_id", createCollectionOptions.configurationId()); - } - if (createCollectionOptions.language() != null) { - contentJson.addProperty("language", createCollectionOptions.language()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List collections. - * - *

Lists existing collections for the service instance. - * - * @param listCollectionsOptions the {@link ListCollectionsOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link ListCollectionsResponse} - */ - public ServiceCall listCollections( - ListCollectionsOptions listCollectionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listCollectionsOptions, "listCollectionsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listCollectionsOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/collections", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listCollections"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (listCollectionsOptions.name() != null) { - builder.query("name", String.valueOf(listCollectionsOptions.name())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get collection details. - * - * @param getCollectionOptions the {@link GetCollectionOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link Collection} - */ - public ServiceCall getCollection(GetCollectionOptions getCollectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getCollectionOptions, "getCollectionOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getCollectionOptions.environmentId()); - pathParamsMap.put("collection_id", getCollectionOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getCollection"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update a collection. - * - * @param updateCollectionOptions the {@link UpdateCollectionOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Collection} - */ - public ServiceCall updateCollection(UpdateCollectionOptions updateCollectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - updateCollectionOptions, "updateCollectionOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", updateCollectionOptions.environmentId()); - pathParamsMap.put("collection_id", updateCollectionOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.put( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "updateCollection"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("name", updateCollectionOptions.name()); - if (updateCollectionOptions.description() != null) { - contentJson.addProperty("description", updateCollectionOptions.description()); - } - if (updateCollectionOptions.configurationId() != null) { - contentJson.addProperty("configuration_id", updateCollectionOptions.configurationId()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a collection. - * - * @param deleteCollectionOptions the {@link DeleteCollectionOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link DeleteCollectionResponse} - */ - public ServiceCall deleteCollection( - DeleteCollectionOptions deleteCollectionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteCollectionOptions, "deleteCollectionOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteCollectionOptions.environmentId()); - pathParamsMap.put("collection_id", deleteCollectionOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "deleteCollection"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List collection fields. - * - *

Gets a list of the unique fields (and their types) stored in the index. - * - * @param listCollectionFieldsOptions the {@link ListCollectionFieldsOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link ListCollectionFieldsResponse} - */ - public ServiceCall listCollectionFields( - ListCollectionFieldsOptions listCollectionFieldsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listCollectionFieldsOptions, "listCollectionFieldsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listCollectionFieldsOptions.environmentId()); - pathParamsMap.put("collection_id", listCollectionFieldsOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/fields", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "listCollectionFields"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get the expansion list. - * - *

Returns the current expansion list for the specified collection. If an expansion list is not - * specified, an object with empty expansion arrays is returned. - * - * @param listExpansionsOptions the {@link ListExpansionsOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link Expansions} - */ - public ServiceCall listExpansions(ListExpansionsOptions listExpansionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listExpansionsOptions, "listExpansionsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listExpansionsOptions.environmentId()); - pathParamsMap.put("collection_id", listExpansionsOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/expansions", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listExpansions"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create or update expansion list. - * - *

Create or replace the Expansion list for this collection. The maximum number of expanded - * terms per collection is `500`. The current expansion list is replaced with the uploaded - * content. - * - * @param createExpansionsOptions the {@link CreateExpansionsOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Expansions} - */ - public ServiceCall createExpansions(CreateExpansionsOptions createExpansionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createExpansionsOptions, "createExpansionsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createExpansionsOptions.environmentId()); - pathParamsMap.put("collection_id", createExpansionsOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/expansions", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "createExpansions"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.add( - "expansions", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createExpansionsOptions.expansions())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete the expansion list. - * - *

Remove the expansion information for this collection. The expansion list must be deleted to - * disable query expansion for a collection. - * - * @param deleteExpansionsOptions the {@link DeleteExpansionsOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteExpansions(DeleteExpansionsOptions deleteExpansionsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteExpansionsOptions, "deleteExpansionsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteExpansionsOptions.environmentId()); - pathParamsMap.put("collection_id", deleteExpansionsOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/expansions", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "deleteExpansions"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get tokenization dictionary status. - * - *

Returns the current status of the tokenization dictionary for the specified collection. - * - * @param getTokenizationDictionaryStatusOptions the {@link - * GetTokenizationDictionaryStatusOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link TokenDictStatusResponse} - */ - public ServiceCall getTokenizationDictionaryStatus( - GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getTokenizationDictionaryStatusOptions, - "getTokenizationDictionaryStatusOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getTokenizationDictionaryStatusOptions.environmentId()); - pathParamsMap.put("collection_id", getTokenizationDictionaryStatusOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getTokenizationDictionaryStatus"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create tokenization dictionary. - * - *

Upload a custom tokenization dictionary to use with the specified collection. - * - * @param createTokenizationDictionaryOptions the {@link CreateTokenizationDictionaryOptions} - * containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link TokenDictStatusResponse} - */ - public ServiceCall createTokenizationDictionary( - CreateTokenizationDictionaryOptions createTokenizationDictionaryOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createTokenizationDictionaryOptions, "createTokenizationDictionaryOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createTokenizationDictionaryOptions.environmentId()); - pathParamsMap.put("collection_id", createTokenizationDictionaryOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "createTokenizationDictionary"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (createTokenizationDictionaryOptions.tokenizationRules() != null) { - contentJson.add( - "tokenization_rules", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createTokenizationDictionaryOptions.tokenizationRules())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete tokenization dictionary. - * - *

Delete the tokenization dictionary from the collection. - * - * @param deleteTokenizationDictionaryOptions the {@link DeleteTokenizationDictionaryOptions} - * containing the options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteTokenizationDictionary( - DeleteTokenizationDictionaryOptions deleteTokenizationDictionaryOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteTokenizationDictionaryOptions, "deleteTokenizationDictionaryOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteTokenizationDictionaryOptions.environmentId()); - pathParamsMap.put("collection_id", deleteTokenizationDictionaryOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteTokenizationDictionary"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get stopword list status. - * - *

Returns the current status of the stopword list for the specified collection. - * - * @param getStopwordListStatusOptions the {@link GetStopwordListStatusOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link TokenDictStatusResponse} - */ - public ServiceCall getStopwordListStatus( - GetStopwordListStatusOptions getStopwordListStatusOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getStopwordListStatusOptions, "getStopwordListStatusOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getStopwordListStatusOptions.environmentId()); - pathParamsMap.put("collection_id", getStopwordListStatusOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getStopwordListStatus"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create stopword list. - * - *

Upload a custom stopword list to use with the specified collection. - * - * @param createStopwordListOptions the {@link CreateStopwordListOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link TokenDictStatusResponse} - */ - public ServiceCall createStopwordList( - CreateStopwordListOptions createStopwordListOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createStopwordListOptions, "createStopwordListOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createStopwordListOptions.environmentId()); - pathParamsMap.put("collection_id", createStopwordListOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "createStopwordList"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); - multipartBuilder.setType(MultipartBody.FORM); - okhttp3.RequestBody stopwordFileBody = - RequestUtils.inputStreamBody( - createStopwordListOptions.stopwordFile(), "application/octet-stream"); - multipartBuilder.addFormDataPart( - "stopword_file", createStopwordListOptions.stopwordFilename(), stopwordFileBody); - builder.body(multipartBuilder.build()); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a custom stopword list. - * - *

Delete a custom stopword list from the collection. After a custom stopword list is deleted, - * the default list is used for the collection. - * - * @param deleteStopwordListOptions the {@link DeleteStopwordListOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteStopwordList(DeleteStopwordListOptions deleteStopwordListOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteStopwordListOptions, "deleteStopwordListOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteStopwordListOptions.environmentId()); - pathParamsMap.put("collection_id", deleteStopwordListOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteStopwordList"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Add a document. - * - *

Add a document to a collection with optional metadata. - * - *

* The **version** query parameter is still required. - * - *

* Returns immediately after the system has accepted the document for processing. - * - *

* The user must provide document content, metadata, or both. If the request is missing both - * document content and metadata, it is rejected. - * - *

* The user can set the **Content-Type** parameter on the **file** part to indicate the media - * type of the document. If the **Content-Type** parameter is missing or is one of the generic - * media types (for example, `application/octet-stream`), then the service attempts to - * automatically detect the document's media type. - * - *

* The following field names are reserved and will be filtered out if present after - * normalization: `id`, `score`, `highlight`, and any field with the prefix of: `_`, `+`, or `-` - * - *

* Fields with empty name values after normalization are filtered out before indexing. - * - *

* Fields containing the following characters after normalization are filtered out before - * indexing: `#` and `,` - * - *

**Note:** Documents can be added with a specific **document_id** by using the - * **_/v1/environments/{environment_id}/collections/{collection_id}/documents** method. - * - * @param addDocumentOptions the {@link AddDocumentOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DocumentAccepted} - */ - public ServiceCall addDocument(AddDocumentOptions addDocumentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - addDocumentOptions, "addDocumentOptions cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.isTrue( - (addDocumentOptions.file() != null) || (addDocumentOptions.metadata() != null), - "At least one of file or metadata must be supplied."); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", addDocumentOptions.environmentId()); - pathParamsMap.put("collection_id", addDocumentOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/documents", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "addDocument"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); - multipartBuilder.setType(MultipartBody.FORM); - if (addDocumentOptions.file() != null) { - okhttp3.RequestBody fileBody = - RequestUtils.inputStreamBody( - addDocumentOptions.file(), addDocumentOptions.fileContentType()); - multipartBuilder.addFormDataPart("file", addDocumentOptions.filename(), fileBody); - } - if (addDocumentOptions.metadata() != null) { - multipartBuilder.addFormDataPart("metadata", addDocumentOptions.metadata()); - } - builder.body(multipartBuilder.build()); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get document details. - * - *

Fetch status details about a submitted document. **Note:** this operation does not return - * the document itself. Instead, it returns only the document's processing status and any notices - * (warnings or errors) that were generated when the document was ingested. Use the query API to - * retrieve the actual document content. - * - * @param getDocumentStatusOptions the {@link GetDocumentStatusOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link DocumentStatus} - */ - public ServiceCall getDocumentStatus( - GetDocumentStatusOptions getDocumentStatusOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getDocumentStatusOptions, "getDocumentStatusOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getDocumentStatusOptions.environmentId()); - pathParamsMap.put("collection_id", getDocumentStatusOptions.collectionId()); - pathParamsMap.put("document_id", getDocumentStatusOptions.documentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getDocumentStatus"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update a document. - * - *

Replace an existing document or add a document with a specified **document_id**. Starts - * ingesting a document with optional metadata. - * - *

**Note:** When uploading a new document with this method it automatically replaces any - * document stored with the same **document_id** if it exists. - * - * @param updateDocumentOptions the {@link UpdateDocumentOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link DocumentAccepted} - */ - public ServiceCall updateDocument(UpdateDocumentOptions updateDocumentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - updateDocumentOptions, "updateDocumentOptions cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.isTrue( - (updateDocumentOptions.file() != null) || (updateDocumentOptions.metadata() != null), - "At least one of file or metadata must be supplied."); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", updateDocumentOptions.environmentId()); - pathParamsMap.put("collection_id", updateDocumentOptions.collectionId()); - pathParamsMap.put("document_id", updateDocumentOptions.documentId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "updateDocument"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); - multipartBuilder.setType(MultipartBody.FORM); - if (updateDocumentOptions.file() != null) { - okhttp3.RequestBody fileBody = - RequestUtils.inputStreamBody( - updateDocumentOptions.file(), updateDocumentOptions.fileContentType()); - multipartBuilder.addFormDataPart("file", updateDocumentOptions.filename(), fileBody); - } - if (updateDocumentOptions.metadata() != null) { - multipartBuilder.addFormDataPart("metadata", updateDocumentOptions.metadata()); - } - builder.body(multipartBuilder.build()); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a document. - * - *

If the given document ID is invalid, or if the document is not found, then the a success - * response is returned (HTTP status code `200`) with the status set to 'deleted'. - * - * @param deleteDocumentOptions the {@link DeleteDocumentOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link DeleteDocumentResponse} - */ - public ServiceCall deleteDocument( - DeleteDocumentOptions deleteDocumentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteDocumentOptions, "deleteDocumentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteDocumentOptions.environmentId()); - pathParamsMap.put("collection_id", deleteDocumentOptions.collectionId()); - pathParamsMap.put("document_id", deleteDocumentOptions.documentId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "deleteDocument"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Query a collection. - * - *

By using this method, you can construct long queries. For details, see the [Discovery - * documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts). - * - * @param queryOptions the {@link QueryOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link QueryResponse} - */ - public ServiceCall query(QueryOptions queryOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(queryOptions, "queryOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", queryOptions.environmentId()); - pathParamsMap.put("collection_id", queryOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/query", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "query"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (queryOptions.xWatsonLoggingOptOut() != null) { - builder.header("X-Watson-Logging-Opt-Out", queryOptions.xWatsonLoggingOptOut()); - } - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (queryOptions.filter() != null) { - contentJson.addProperty("filter", queryOptions.filter()); - } - if (queryOptions.query() != null) { - contentJson.addProperty("query", queryOptions.query()); - } - if (queryOptions.naturalLanguageQuery() != null) { - contentJson.addProperty("natural_language_query", queryOptions.naturalLanguageQuery()); - } - if (queryOptions.passages() != null) { - contentJson.addProperty("passages", queryOptions.passages()); - } - if (queryOptions.aggregation() != null) { - contentJson.addProperty("aggregation", queryOptions.aggregation()); - } - if (queryOptions.count() != null) { - contentJson.addProperty("count", queryOptions.count()); - } - if (queryOptions.xReturn() != null) { - contentJson.addProperty("return", queryOptions.xReturn()); - } - if (queryOptions.offset() != null) { - contentJson.addProperty("offset", queryOptions.offset()); - } - if (queryOptions.sort() != null) { - contentJson.addProperty("sort", queryOptions.sort()); - } - if (queryOptions.highlight() != null) { - contentJson.addProperty("highlight", queryOptions.highlight()); - } - if (queryOptions.passagesFields() != null) { - contentJson.addProperty("passages.fields", queryOptions.passagesFields()); - } - if (queryOptions.passagesCount() != null) { - contentJson.addProperty("passages.count", queryOptions.passagesCount()); - } - if (queryOptions.passagesCharacters() != null) { - contentJson.addProperty("passages.characters", queryOptions.passagesCharacters()); - } - if (queryOptions.deduplicate() != null) { - contentJson.addProperty("deduplicate", queryOptions.deduplicate()); - } - if (queryOptions.deduplicateField() != null) { - contentJson.addProperty("deduplicate.field", queryOptions.deduplicateField()); - } - if (queryOptions.similar() != null) { - contentJson.addProperty("similar", queryOptions.similar()); - } - if (queryOptions.similarDocumentIds() != null) { - contentJson.addProperty("similar.document_ids", queryOptions.similarDocumentIds()); - } - if (queryOptions.similarFields() != null) { - contentJson.addProperty("similar.fields", queryOptions.similarFields()); - } - if (queryOptions.bias() != null) { - contentJson.addProperty("bias", queryOptions.bias()); - } - if (queryOptions.spellingSuggestions() != null) { - contentJson.addProperty("spelling_suggestions", queryOptions.spellingSuggestions()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Query system notices. - * - *

Queries for notices (errors or warnings) that might have been generated by the system. - * Notices are generated when ingesting documents and performing relevance training. See the - * [Discovery - * documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts) - * for more details on the query language. - * - * @param queryNoticesOptions the {@link QueryNoticesOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link QueryNoticesResponse} - */ - public ServiceCall queryNotices(QueryNoticesOptions queryNoticesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - queryNoticesOptions, "queryNoticesOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", queryNoticesOptions.environmentId()); - pathParamsMap.put("collection_id", queryNoticesOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/notices", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "queryNotices"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (queryNoticesOptions.filter() != null) { - builder.query("filter", String.valueOf(queryNoticesOptions.filter())); - } - if (queryNoticesOptions.query() != null) { - builder.query("query", String.valueOf(queryNoticesOptions.query())); - } - if (queryNoticesOptions.naturalLanguageQuery() != null) { - builder.query( - "natural_language_query", String.valueOf(queryNoticesOptions.naturalLanguageQuery())); - } - if (queryNoticesOptions.passages() != null) { - builder.query("passages", String.valueOf(queryNoticesOptions.passages())); - } - if (queryNoticesOptions.aggregation() != null) { - builder.query("aggregation", String.valueOf(queryNoticesOptions.aggregation())); - } - if (queryNoticesOptions.count() != null) { - builder.query("count", String.valueOf(queryNoticesOptions.count())); - } - if (queryNoticesOptions.xReturn() != null) { - builder.query("return", RequestUtils.join(queryNoticesOptions.xReturn(), ",")); - } - if (queryNoticesOptions.offset() != null) { - builder.query("offset", String.valueOf(queryNoticesOptions.offset())); - } - if (queryNoticesOptions.sort() != null) { - builder.query("sort", RequestUtils.join(queryNoticesOptions.sort(), ",")); - } - if (queryNoticesOptions.highlight() != null) { - builder.query("highlight", String.valueOf(queryNoticesOptions.highlight())); - } - if (queryNoticesOptions.passagesFields() != null) { - builder.query( - "passages.fields", RequestUtils.join(queryNoticesOptions.passagesFields(), ",")); - } - if (queryNoticesOptions.passagesCount() != null) { - builder.query("passages.count", String.valueOf(queryNoticesOptions.passagesCount())); - } - if (queryNoticesOptions.passagesCharacters() != null) { - builder.query( - "passages.characters", String.valueOf(queryNoticesOptions.passagesCharacters())); - } - if (queryNoticesOptions.deduplicateField() != null) { - builder.query("deduplicate.field", String.valueOf(queryNoticesOptions.deduplicateField())); - } - if (queryNoticesOptions.similar() != null) { - builder.query("similar", String.valueOf(queryNoticesOptions.similar())); - } - if (queryNoticesOptions.similarDocumentIds() != null) { - builder.query( - "similar.document_ids", RequestUtils.join(queryNoticesOptions.similarDocumentIds(), ",")); - } - if (queryNoticesOptions.similarFields() != null) { - builder.query("similar.fields", RequestUtils.join(queryNoticesOptions.similarFields(), ",")); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Query multiple collections. - * - *

By using this method, you can construct long queries that search multiple collection. For - * details, see the [Discovery - * documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts). - * - * @param federatedQueryOptions the {@link FederatedQueryOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link QueryResponse} - */ - public ServiceCall federatedQuery(FederatedQueryOptions federatedQueryOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - federatedQueryOptions, "federatedQueryOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", federatedQueryOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/query", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "federatedQuery"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - if (federatedQueryOptions.xWatsonLoggingOptOut() != null) { - builder.header("X-Watson-Logging-Opt-Out", federatedQueryOptions.xWatsonLoggingOptOut()); - } - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("collection_ids", federatedQueryOptions.collectionIds()); - if (federatedQueryOptions.filter() != null) { - contentJson.addProperty("filter", federatedQueryOptions.filter()); - } - if (federatedQueryOptions.query() != null) { - contentJson.addProperty("query", federatedQueryOptions.query()); - } - if (federatedQueryOptions.naturalLanguageQuery() != null) { - contentJson.addProperty( - "natural_language_query", federatedQueryOptions.naturalLanguageQuery()); - } - if (federatedQueryOptions.passages() != null) { - contentJson.addProperty("passages", federatedQueryOptions.passages()); - } - if (federatedQueryOptions.aggregation() != null) { - contentJson.addProperty("aggregation", federatedQueryOptions.aggregation()); - } - if (federatedQueryOptions.count() != null) { - contentJson.addProperty("count", federatedQueryOptions.count()); - } - if (federatedQueryOptions.xReturn() != null) { - contentJson.addProperty("return", federatedQueryOptions.xReturn()); - } - if (federatedQueryOptions.offset() != null) { - contentJson.addProperty("offset", federatedQueryOptions.offset()); - } - if (federatedQueryOptions.sort() != null) { - contentJson.addProperty("sort", federatedQueryOptions.sort()); - } - if (federatedQueryOptions.highlight() != null) { - contentJson.addProperty("highlight", federatedQueryOptions.highlight()); - } - if (federatedQueryOptions.passagesFields() != null) { - contentJson.addProperty("passages.fields", federatedQueryOptions.passagesFields()); - } - if (federatedQueryOptions.passagesCount() != null) { - contentJson.addProperty("passages.count", federatedQueryOptions.passagesCount()); - } - if (federatedQueryOptions.passagesCharacters() != null) { - contentJson.addProperty("passages.characters", federatedQueryOptions.passagesCharacters()); - } - if (federatedQueryOptions.deduplicate() != null) { - contentJson.addProperty("deduplicate", federatedQueryOptions.deduplicate()); - } - if (federatedQueryOptions.deduplicateField() != null) { - contentJson.addProperty("deduplicate.field", federatedQueryOptions.deduplicateField()); - } - if (federatedQueryOptions.similar() != null) { - contentJson.addProperty("similar", federatedQueryOptions.similar()); - } - if (federatedQueryOptions.similarDocumentIds() != null) { - contentJson.addProperty("similar.document_ids", federatedQueryOptions.similarDocumentIds()); - } - if (federatedQueryOptions.similarFields() != null) { - contentJson.addProperty("similar.fields", federatedQueryOptions.similarFields()); - } - if (federatedQueryOptions.bias() != null) { - contentJson.addProperty("bias", federatedQueryOptions.bias()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Query multiple collection system notices. - * - *

Queries for notices (errors or warnings) that might have been generated by the system. - * Notices are generated when ingesting documents and performing relevance training. See the - * [Discovery - * documentation](https://cloud.ibm.com/docs/discovery?topic=discovery-query-concepts#query-concepts) - * for more details on the query language. - * - * @param federatedQueryNoticesOptions the {@link FederatedQueryNoticesOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link QueryNoticesResponse} - */ - public ServiceCall federatedQueryNotices( - FederatedQueryNoticesOptions federatedQueryNoticesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - federatedQueryNoticesOptions, "federatedQueryNoticesOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", federatedQueryNoticesOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/notices", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "federatedQueryNotices"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query( - "collection_ids", RequestUtils.join(federatedQueryNoticesOptions.collectionIds(), ",")); - if (federatedQueryNoticesOptions.filter() != null) { - builder.query("filter", String.valueOf(federatedQueryNoticesOptions.filter())); - } - if (federatedQueryNoticesOptions.query() != null) { - builder.query("query", String.valueOf(federatedQueryNoticesOptions.query())); - } - if (federatedQueryNoticesOptions.naturalLanguageQuery() != null) { - builder.query( - "natural_language_query", - String.valueOf(federatedQueryNoticesOptions.naturalLanguageQuery())); - } - if (federatedQueryNoticesOptions.aggregation() != null) { - builder.query("aggregation", String.valueOf(federatedQueryNoticesOptions.aggregation())); - } - if (federatedQueryNoticesOptions.count() != null) { - builder.query("count", String.valueOf(federatedQueryNoticesOptions.count())); - } - if (federatedQueryNoticesOptions.xReturn() != null) { - builder.query("return", RequestUtils.join(federatedQueryNoticesOptions.xReturn(), ",")); - } - if (federatedQueryNoticesOptions.offset() != null) { - builder.query("offset", String.valueOf(federatedQueryNoticesOptions.offset())); - } - if (federatedQueryNoticesOptions.sort() != null) { - builder.query("sort", RequestUtils.join(federatedQueryNoticesOptions.sort(), ",")); - } - if (federatedQueryNoticesOptions.highlight() != null) { - builder.query("highlight", String.valueOf(federatedQueryNoticesOptions.highlight())); - } - if (federatedQueryNoticesOptions.deduplicateField() != null) { - builder.query( - "deduplicate.field", String.valueOf(federatedQueryNoticesOptions.deduplicateField())); - } - if (federatedQueryNoticesOptions.similar() != null) { - builder.query("similar", String.valueOf(federatedQueryNoticesOptions.similar())); - } - if (federatedQueryNoticesOptions.similarDocumentIds() != null) { - builder.query( - "similar.document_ids", - RequestUtils.join(federatedQueryNoticesOptions.similarDocumentIds(), ",")); - } - if (federatedQueryNoticesOptions.similarFields() != null) { - builder.query( - "similar.fields", RequestUtils.join(federatedQueryNoticesOptions.similarFields(), ",")); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get Autocomplete Suggestions. - * - *

Returns completion query suggestions for the specified prefix. /n/n **Important:** this - * method is only valid when using the Cloud Pak version of Discovery. - * - * @param getAutocompletionOptions the {@link GetAutocompletionOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Completions} - */ - public ServiceCall getAutocompletion( - GetAutocompletionOptions getAutocompletionOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getAutocompletionOptions, "getAutocompletionOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getAutocompletionOptions.environmentId()); - pathParamsMap.put("collection_id", getAutocompletionOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/autocompletion", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getAutocompletion"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("prefix", String.valueOf(getAutocompletionOptions.prefix())); - if (getAutocompletionOptions.field() != null) { - builder.query("field", String.valueOf(getAutocompletionOptions.field())); - } - if (getAutocompletionOptions.count() != null) { - builder.query("count", String.valueOf(getAutocompletionOptions.count())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List training data. - * - *

Lists the training data for the specified collection. - * - * @param listTrainingDataOptions the {@link ListTrainingDataOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link TrainingDataSet} - */ - public ServiceCall listTrainingData( - ListTrainingDataOptions listTrainingDataOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listTrainingDataOptions, "listTrainingDataOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listTrainingDataOptions.environmentId()); - pathParamsMap.put("collection_id", listTrainingDataOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listTrainingData"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Add query to training data. - * - *

Adds a query to the training data for this collection. The query can contain a filter and - * natural language query. - * - * @param addTrainingDataOptions the {@link AddTrainingDataOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link TrainingQuery} - */ - public ServiceCall addTrainingData(AddTrainingDataOptions addTrainingDataOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - addTrainingDataOptions, "addTrainingDataOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", addTrainingDataOptions.environmentId()); - pathParamsMap.put("collection_id", addTrainingDataOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "addTrainingData"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (addTrainingDataOptions.naturalLanguageQuery() != null) { - contentJson.addProperty( - "natural_language_query", addTrainingDataOptions.naturalLanguageQuery()); - } - if (addTrainingDataOptions.filter() != null) { - contentJson.addProperty("filter", addTrainingDataOptions.filter()); - } - if (addTrainingDataOptions.examples() != null) { - contentJson.add( - "examples", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(addTrainingDataOptions.examples())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete all training data. - * - *

Deletes all training data from a collection. - * - * @param deleteAllTrainingDataOptions the {@link DeleteAllTrainingDataOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteAllTrainingData( - DeleteAllTrainingDataOptions deleteAllTrainingDataOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteAllTrainingDataOptions, "deleteAllTrainingDataOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteAllTrainingDataOptions.environmentId()); - pathParamsMap.put("collection_id", deleteAllTrainingDataOptions.collectionId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteAllTrainingData"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get details about a query. - * - *

Gets details for a specific training data query, including the query string and all - * examples. - * - * @param getTrainingDataOptions the {@link GetTrainingDataOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link TrainingQuery} - */ - public ServiceCall getTrainingData(GetTrainingDataOptions getTrainingDataOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getTrainingDataOptions, "getTrainingDataOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getTrainingDataOptions.environmentId()); - pathParamsMap.put("collection_id", getTrainingDataOptions.collectionId()); - pathParamsMap.put("query_id", getTrainingDataOptions.queryId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getTrainingData"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete a training data query. - * - *

Removes the training data query and all associated examples from the training data set. - * - * @param deleteTrainingDataOptions the {@link DeleteTrainingDataOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteTrainingData(DeleteTrainingDataOptions deleteTrainingDataOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteTrainingDataOptions, "deleteTrainingDataOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteTrainingDataOptions.environmentId()); - pathParamsMap.put("collection_id", deleteTrainingDataOptions.collectionId()); - pathParamsMap.put("query_id", deleteTrainingDataOptions.queryId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteTrainingData"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List examples for a training data query. - * - *

List all examples for this training data query. - * - * @param listTrainingExamplesOptions the {@link ListTrainingExamplesOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link TrainingExampleList} - */ - public ServiceCall listTrainingExamples( - ListTrainingExamplesOptions listTrainingExamplesOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listTrainingExamplesOptions, "listTrainingExamplesOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listTrainingExamplesOptions.environmentId()); - pathParamsMap.put("collection_id", listTrainingExamplesOptions.collectionId()); - pathParamsMap.put("query_id", listTrainingExamplesOptions.queryId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "listTrainingExamples"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Add example to training data query. - * - *

Adds a example to this training data query. - * - * @param createTrainingExampleOptions the {@link CreateTrainingExampleOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link TrainingExample} - */ - public ServiceCall createTrainingExample( - CreateTrainingExampleOptions createTrainingExampleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createTrainingExampleOptions, "createTrainingExampleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createTrainingExampleOptions.environmentId()); - pathParamsMap.put("collection_id", createTrainingExampleOptions.collectionId()); - pathParamsMap.put("query_id", createTrainingExampleOptions.queryId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "createTrainingExample"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (createTrainingExampleOptions.documentId() != null) { - contentJson.addProperty("document_id", createTrainingExampleOptions.documentId()); - } - if (createTrainingExampleOptions.crossReference() != null) { - contentJson.addProperty("cross_reference", createTrainingExampleOptions.crossReference()); - } - if (createTrainingExampleOptions.relevance() != null) { - contentJson.addProperty("relevance", createTrainingExampleOptions.relevance()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete example for training data query. - * - *

Deletes the example document with the given ID from the training data query. - * - * @param deleteTrainingExampleOptions the {@link DeleteTrainingExampleOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteTrainingExample( - DeleteTrainingExampleOptions deleteTrainingExampleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteTrainingExampleOptions, "deleteTrainingExampleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteTrainingExampleOptions.environmentId()); - pathParamsMap.put("collection_id", deleteTrainingExampleOptions.collectionId()); - pathParamsMap.put("query_id", deleteTrainingExampleOptions.queryId()); - pathParamsMap.put("example_id", deleteTrainingExampleOptions.exampleId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteTrainingExample"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Change label or cross reference for example. - * - *

Changes the label or cross reference query for this training data example. - * - * @param updateTrainingExampleOptions the {@link UpdateTrainingExampleOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link TrainingExample} - */ - public ServiceCall updateTrainingExample( - UpdateTrainingExampleOptions updateTrainingExampleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - updateTrainingExampleOptions, "updateTrainingExampleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", updateTrainingExampleOptions.environmentId()); - pathParamsMap.put("collection_id", updateTrainingExampleOptions.collectionId()); - pathParamsMap.put("query_id", updateTrainingExampleOptions.queryId()); - pathParamsMap.put("example_id", updateTrainingExampleOptions.exampleId()); - RequestBuilder builder = - RequestBuilder.put( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "updateTrainingExample"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (updateTrainingExampleOptions.crossReference() != null) { - contentJson.addProperty("cross_reference", updateTrainingExampleOptions.crossReference()); - } - if (updateTrainingExampleOptions.relevance() != null) { - contentJson.addProperty("relevance", updateTrainingExampleOptions.relevance()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get details for training data example. - * - *

Gets the details for this training example. - * - * @param getTrainingExampleOptions the {@link GetTrainingExampleOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link TrainingExample} - */ - public ServiceCall getTrainingExample( - GetTrainingExampleOptions getTrainingExampleOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getTrainingExampleOptions, "getTrainingExampleOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getTrainingExampleOptions.environmentId()); - pathParamsMap.put("collection_id", getTrainingExampleOptions.collectionId()); - pathParamsMap.put("query_id", getTrainingExampleOptions.queryId()); - pathParamsMap.put("example_id", getTrainingExampleOptions.exampleId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getTrainingExample"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete labeled data. - * - *

Deletes all data associated with a specified customer ID. The method has no effect if no - * data is associated with the customer ID. - * - *

You associate a customer ID with data by passing the **X-Watson-Metadata** header with a - * request that passes data. For more information about personal data and customer IDs, see - * [Information - * security](https://cloud.ibm.com/docs/discovery?topic=discovery-information-security#information-security). - * - * @param deleteUserDataOptions the {@link DeleteUserDataOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteUserData(DeleteUserDataOptions deleteUserDataOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteUserDataOptions, "deleteUserDataOptions cannot be null"); - RequestBuilder builder = - RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/user_data")); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "deleteUserData"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - builder.query("customer_id", String.valueOf(deleteUserDataOptions.customerId())); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create event. - * - *

The **Events** API can be used to create log entries that are associated with specific - * queries. For example, you can record which documents in the results set were "clicked" by a - * user and when that click occurred. - * - * @param createEventOptions the {@link CreateEventOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link CreateEventResponse} - */ - public ServiceCall createEvent(CreateEventOptions createEventOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createEventOptions, "createEventOptions cannot be null"); - RequestBuilder builder = - RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/events")); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "createEvent"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.addProperty("type", createEventOptions.type()); - contentJson.add( - "data", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(createEventOptions.data())); - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Search the query and event log. - * - *

Searches the query and event log to find query sessions that match the specified criteria. - * Searching the **logs** endpoint uses the standard Discovery query syntax for the parameters - * that are supported. - * - * @param queryLogOptions the {@link QueryLogOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link LogQueryResponse} - */ - public ServiceCall queryLog(QueryLogOptions queryLogOptions) { - if (queryLogOptions == null) { - queryLogOptions = new QueryLogOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/logs")); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "queryLog"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (queryLogOptions.filter() != null) { - builder.query("filter", String.valueOf(queryLogOptions.filter())); - } - if (queryLogOptions.query() != null) { - builder.query("query", String.valueOf(queryLogOptions.query())); - } - if (queryLogOptions.count() != null) { - builder.query("count", String.valueOf(queryLogOptions.count())); - } - if (queryLogOptions.offset() != null) { - builder.query("offset", String.valueOf(queryLogOptions.offset())); - } - if (queryLogOptions.sort() != null) { - builder.query("sort", RequestUtils.join(queryLogOptions.sort(), ",")); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Search the query and event log. - * - *

Searches the query and event log to find query sessions that match the specified criteria. - * Searching the **logs** endpoint uses the standard Discovery query syntax for the parameters - * that are supported. - * - * @return a {@link ServiceCall} with a result of type {@link LogQueryResponse} - */ - public ServiceCall queryLog() { - return queryLog(null); - } - - /** - * Number of queries over time. - * - *

Total number of queries using the **natural_language_query** parameter over a specific time - * window. - * - * @param getMetricsQueryOptions the {@link GetMetricsQueryOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsQuery( - GetMetricsQueryOptions getMetricsQueryOptions) { - if (getMetricsQueryOptions == null) { - getMetricsQueryOptions = new GetMetricsQueryOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/metrics/number_of_queries")); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getMetricsQuery"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (getMetricsQueryOptions.startTime() != null) { - builder.query("start_time", DateUtils.formatAsDateTime(getMetricsQueryOptions.startTime())); - } - if (getMetricsQueryOptions.endTime() != null) { - builder.query("end_time", DateUtils.formatAsDateTime(getMetricsQueryOptions.endTime())); - } - if (getMetricsQueryOptions.resultType() != null) { - builder.query("result_type", String.valueOf(getMetricsQueryOptions.resultType())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Number of queries over time. - * - *

Total number of queries using the **natural_language_query** parameter over a specific time - * window. - * - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsQuery() { - return getMetricsQuery(null); - } - - /** - * Number of queries with an event over time. - * - *

Total number of queries using the **natural_language_query** parameter that have a - * corresponding "click" event over a specified time window. This metric requires having - * integrated event tracking in your application using the **Events** API. - * - * @param getMetricsQueryEventOptions the {@link GetMetricsQueryEventOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsQueryEvent( - GetMetricsQueryEventOptions getMetricsQueryEventOptions) { - if (getMetricsQueryEventOptions == null) { - getMetricsQueryEventOptions = new GetMetricsQueryEventOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/metrics/number_of_queries_with_event")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getMetricsQueryEvent"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (getMetricsQueryEventOptions.startTime() != null) { - builder.query( - "start_time", DateUtils.formatAsDateTime(getMetricsQueryEventOptions.startTime())); - } - if (getMetricsQueryEventOptions.endTime() != null) { - builder.query("end_time", DateUtils.formatAsDateTime(getMetricsQueryEventOptions.endTime())); - } - if (getMetricsQueryEventOptions.resultType() != null) { - builder.query("result_type", String.valueOf(getMetricsQueryEventOptions.resultType())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Number of queries with an event over time. - * - *

Total number of queries using the **natural_language_query** parameter that have a - * corresponding "click" event over a specified time window. This metric requires having - * integrated event tracking in your application using the **Events** API. - * - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsQueryEvent() { - return getMetricsQueryEvent(null); - } - - /** - * Number of queries with no search results over time. - * - *

Total number of queries using the **natural_language_query** parameter that have no results - * returned over a specified time window. - * - * @param getMetricsQueryNoResultsOptions the {@link GetMetricsQueryNoResultsOptions} containing - * the options for the call - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsQueryNoResults( - GetMetricsQueryNoResultsOptions getMetricsQueryNoResultsOptions) { - if (getMetricsQueryNoResultsOptions == null) { - getMetricsQueryNoResultsOptions = new GetMetricsQueryNoResultsOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/metrics/number_of_queries_with_no_search_results")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getMetricsQueryNoResults"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (getMetricsQueryNoResultsOptions.startTime() != null) { - builder.query( - "start_time", DateUtils.formatAsDateTime(getMetricsQueryNoResultsOptions.startTime())); - } - if (getMetricsQueryNoResultsOptions.endTime() != null) { - builder.query( - "end_time", DateUtils.formatAsDateTime(getMetricsQueryNoResultsOptions.endTime())); - } - if (getMetricsQueryNoResultsOptions.resultType() != null) { - builder.query("result_type", String.valueOf(getMetricsQueryNoResultsOptions.resultType())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Number of queries with no search results over time. - * - *

Total number of queries using the **natural_language_query** parameter that have no results - * returned over a specified time window. - * - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsQueryNoResults() { - return getMetricsQueryNoResults(null); - } - - /** - * Percentage of queries with an associated event. - * - *

The percentage of queries using the **natural_language_query** parameter that have a - * corresponding "click" event over a specified time window. This metric requires having - * integrated event tracking in your application using the **Events** API. - * - * @param getMetricsEventRateOptions the {@link GetMetricsEventRateOptions} containing the options - * for the call - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsEventRate( - GetMetricsEventRateOptions getMetricsEventRateOptions) { - if (getMetricsEventRateOptions == null) { - getMetricsEventRateOptions = new GetMetricsEventRateOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v1/metrics/event_rate")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getMetricsEventRate"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (getMetricsEventRateOptions.startTime() != null) { - builder.query( - "start_time", DateUtils.formatAsDateTime(getMetricsEventRateOptions.startTime())); - } - if (getMetricsEventRateOptions.endTime() != null) { - builder.query("end_time", DateUtils.formatAsDateTime(getMetricsEventRateOptions.endTime())); - } - if (getMetricsEventRateOptions.resultType() != null) { - builder.query("result_type", String.valueOf(getMetricsEventRateOptions.resultType())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Percentage of queries with an associated event. - * - *

The percentage of queries using the **natural_language_query** parameter that have a - * corresponding "click" event over a specified time window. This metric requires having - * integrated event tracking in your application using the **Events** API. - * - * @return a {@link ServiceCall} with a result of type {@link MetricResponse} - */ - public ServiceCall getMetricsEventRate() { - return getMetricsEventRate(null); - } - - /** - * Most frequent query tokens with an event. - * - *

The most frequent query tokens parsed from the **natural_language_query** parameter and - * their corresponding "click" event rate within the recording period (queries and events are - * stored for 30 days). A query token is an individual word or unigram within the query string. - * - * @param getMetricsQueryTokenEventOptions the {@link GetMetricsQueryTokenEventOptions} containing - * the options for the call - * @return a {@link ServiceCall} with a result of type {@link MetricTokenResponse} - */ - public ServiceCall getMetricsQueryTokenEvent( - GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptions) { - if (getMetricsQueryTokenEventOptions == null) { - getMetricsQueryTokenEventOptions = new GetMetricsQueryTokenEventOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/metrics/top_query_tokens_with_event_rate")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "getMetricsQueryTokenEvent"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (getMetricsQueryTokenEventOptions.count() != null) { - builder.query("count", String.valueOf(getMetricsQueryTokenEventOptions.count())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Most frequent query tokens with an event. - * - *

The most frequent query tokens parsed from the **natural_language_query** parameter and - * their corresponding "click" event rate within the recording period (queries and events are - * stored for 30 days). A query token is an individual word or unigram within the query string. - * - * @return a {@link ServiceCall} with a result of type {@link MetricTokenResponse} - */ - public ServiceCall getMetricsQueryTokenEvent() { - return getMetricsQueryTokenEvent(null); - } - - /** - * List credentials. - * - *

List all the source credentials that have been created for this service instance. - * - *

**Note:** All credentials are sent over an encrypted connection and encrypted at rest. - * - * @param listCredentialsOptions the {@link ListCredentialsOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link CredentialsList} - */ - public ServiceCall listCredentials( - ListCredentialsOptions listCredentialsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listCredentialsOptions, "listCredentialsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listCredentialsOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/credentials", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listCredentials"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create credentials. - * - *

Creates a set of credentials to connect to a remote source. Created credentials are used in - * a configuration to associate a collection with the remote source. - * - *

**Note:** All credentials are sent over an encrypted connection and encrypted at rest. - * - * @param createCredentialsOptions the {@link CreateCredentialsOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Credentials} - */ - public ServiceCall createCredentials( - CreateCredentialsOptions createCredentialsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createCredentialsOptions, "createCredentialsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createCredentialsOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/credentials", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "createCredentials"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (createCredentialsOptions.sourceType() != null) { - contentJson.addProperty("source_type", createCredentialsOptions.sourceType()); - } - if (createCredentialsOptions.credentialDetails() != null) { - contentJson.add( - "credential_details", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createCredentialsOptions.credentialDetails())); - } - if (createCredentialsOptions.status() != null) { - contentJson.add( - "status", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(createCredentialsOptions.status())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * View Credentials. - * - *

Returns details about the specified credentials. - * - *

**Note:** Secure credential information such as a password or SSH key is never returned and - * must be obtained from the source system. - * - * @param getCredentialsOptions the {@link GetCredentialsOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link Credentials} - */ - public ServiceCall getCredentials(GetCredentialsOptions getCredentialsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getCredentialsOptions, "getCredentialsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getCredentialsOptions.environmentId()); - pathParamsMap.put("credential_id", getCredentialsOptions.credentialId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/credentials/{credential_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getCredentials"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Update credentials. - * - *

Updates an existing set of source credentials. - * - *

**Note:** All credentials are sent over an encrypted connection and encrypted at rest. - * - * @param updateCredentialsOptions the {@link UpdateCredentialsOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link Credentials} - */ - public ServiceCall updateCredentials( - UpdateCredentialsOptions updateCredentialsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - updateCredentialsOptions, "updateCredentialsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", updateCredentialsOptions.environmentId()); - pathParamsMap.put("credential_id", updateCredentialsOptions.credentialId()); - RequestBuilder builder = - RequestBuilder.put( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/credentials/{credential_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "updateCredentials"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (updateCredentialsOptions.sourceType() != null) { - contentJson.addProperty("source_type", updateCredentialsOptions.sourceType()); - } - if (updateCredentialsOptions.credentialDetails() != null) { - contentJson.add( - "credential_details", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(updateCredentialsOptions.credentialDetails())); - } - if (updateCredentialsOptions.status() != null) { - contentJson.add( - "status", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson() - .toJsonTree(updateCredentialsOptions.status())); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete credentials. - * - *

Deletes a set of stored credentials from your Discovery instance. - * - * @param deleteCredentialsOptions the {@link DeleteCredentialsOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link DeleteCredentials} - */ - public ServiceCall deleteCredentials( - DeleteCredentialsOptions deleteCredentialsOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteCredentialsOptions, "deleteCredentialsOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteCredentialsOptions.environmentId()); - pathParamsMap.put("credential_id", deleteCredentialsOptions.credentialId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/credentials/{credential_id}", - pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("discovery", "v1", "deleteCredentials"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List Gateways. - * - *

List the currently configured gateways. - * - * @param listGatewaysOptions the {@link ListGatewaysOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link GatewayList} - */ - public ServiceCall listGateways(ListGatewaysOptions listGatewaysOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - listGatewaysOptions, "listGatewaysOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", listGatewaysOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/gateways", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "listGateways"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Create Gateway. - * - *

Create a gateway configuration to use with a remotely installed gateway. - * - * @param createGatewayOptions the {@link CreateGatewayOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link Gateway} - */ - public ServiceCall createGateway(CreateGatewayOptions createGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createGatewayOptions, "createGatewayOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", createGatewayOptions.environmentId()); - RequestBuilder builder = - RequestBuilder.post( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v1/environments/{environment_id}/gateways", pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "createGateway"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - if (createGatewayOptions.name() != null) { - contentJson.addProperty("name", createGatewayOptions.name()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List Gateway Details. - * - *

List information about the specified gateway. - * - * @param getGatewayOptions the {@link GetGatewayOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link Gateway} - */ - public ServiceCall getGateway(GetGatewayOptions getGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getGatewayOptions, "getGatewayOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", getGatewayOptions.environmentId()); - pathParamsMap.put("gateway_id", getGatewayOptions.gatewayId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/gateways/{gateway_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "getGateway"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete Gateway. - * - *

Delete the specified gateway configuration. - * - * @param deleteGatewayOptions the {@link DeleteGatewayOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link GatewayDelete} - */ - public ServiceCall deleteGateway(DeleteGatewayOptions deleteGatewayOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteGatewayOptions, "deleteGatewayOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("environment_id", deleteGatewayOptions.environmentId()); - pathParamsMap.put("gateway_id", deleteGatewayOptions.gatewayId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), - "/v1/environments/{environment_id}/gateways/{gateway_id}", - pathParamsMap)); - Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v1", "deleteGateway"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddDocumentOptions.java deleted file mode 100644 index b8ba8a545ef..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddDocumentOptions.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -/** The addDocument options. */ -public class AddDocumentOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected InputStream file; - protected String filename; - protected String fileContentType; - protected String metadata; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private InputStream file; - private String filename; - private String fileContentType; - private String metadata; - - /** - * Instantiates a new Builder from an existing AddDocumentOptions instance. - * - * @param addDocumentOptions the instance to initialize the Builder with - */ - private Builder(AddDocumentOptions addDocumentOptions) { - this.environmentId = addDocumentOptions.environmentId; - this.collectionId = addDocumentOptions.collectionId; - this.file = addDocumentOptions.file; - this.filename = addDocumentOptions.filename; - this.fileContentType = addDocumentOptions.fileContentType; - this.metadata = addDocumentOptions.metadata; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a AddDocumentOptions. - * - * @return the new AddDocumentOptions instance - */ - public AddDocumentOptions build() { - return new AddDocumentOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the AddDocumentOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the AddDocumentOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the file. - * - * @param file the file - * @return the AddDocumentOptions builder - */ - public Builder file(InputStream file) { - this.file = file; - return this; - } - - /** - * Set the filename. - * - * @param filename the filename - * @return the AddDocumentOptions builder - */ - public Builder filename(String filename) { - this.filename = filename; - return this; - } - - /** - * Set the fileContentType. - * - * @param fileContentType the fileContentType - * @return the AddDocumentOptions builder - */ - public Builder fileContentType(String fileContentType) { - this.fileContentType = fileContentType; - return this; - } - - /** - * Set the metadata. - * - * @param metadata the metadata - * @return the AddDocumentOptions builder - */ - public Builder metadata(String metadata) { - this.metadata = metadata; - return this; - } - - /** - * Set the file. - * - * @param file the file - * @return the AddDocumentOptions builder - * @throws FileNotFoundException if the file could not be found - */ - public Builder file(File file) throws FileNotFoundException { - this.file = new FileInputStream(file); - this.filename = file.getName(); - return this; - } - } - - protected AddDocumentOptions() {} - - protected AddDocumentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.isTrue( - (builder.file == null) || (builder.filename != null), - "filename cannot be null if file is not null."); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - file = builder.file; - filename = builder.filename; - fileContentType = builder.fileContentType; - metadata = builder.metadata; - } - - /** - * New builder. - * - * @return a AddDocumentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the file. - * - *

The content of the document to ingest. The maximum supported file size when adding a file to - * a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 - * megabyte. Files larger than the supported size are rejected. - * - * @return the file - */ - public InputStream file() { - return file; - } - - /** - * Gets the filename. - * - *

The filename for file. - * - * @return the filename - */ - public String filename() { - return filename; - } - - /** - * Gets the fileContentType. - * - *

The content type of file. Values for this parameter can be obtained from the HttpMediaType - * class. - * - * @return the fileContentType - */ - public String fileContentType() { - return fileContentType; - } - - /** - * Gets the metadata. - * - *

The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are - * rejected. Example: ``` { "Creator": "Johnny Appleseed", "Subject": "Apples" } ```. - * - * @return the metadata - */ - public String metadata() { - return metadata; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptions.java deleted file mode 100644 index 84c57841bcf..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptions.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The addTrainingData options. */ -public class AddTrainingDataOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String naturalLanguageQuery; - protected String filter; - protected List examples; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String naturalLanguageQuery; - private String filter; - private List examples; - - /** - * Instantiates a new Builder from an existing AddTrainingDataOptions instance. - * - * @param addTrainingDataOptions the instance to initialize the Builder with - */ - private Builder(AddTrainingDataOptions addTrainingDataOptions) { - this.environmentId = addTrainingDataOptions.environmentId; - this.collectionId = addTrainingDataOptions.collectionId; - this.naturalLanguageQuery = addTrainingDataOptions.naturalLanguageQuery; - this.filter = addTrainingDataOptions.filter; - this.examples = addTrainingDataOptions.examples; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a AddTrainingDataOptions. - * - * @return the new AddTrainingDataOptions instance - */ - public AddTrainingDataOptions build() { - return new AddTrainingDataOptions(this); - } - - /** - * Adds a new element to examples. - * - * @param examples the new element to be added - * @return the AddTrainingDataOptions builder - */ - public Builder addExamples(TrainingExample examples) { - com.ibm.cloud.sdk.core.util.Validator.notNull(examples, "examples cannot be null"); - if (this.examples == null) { - this.examples = new ArrayList(); - } - this.examples.add(examples); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the AddTrainingDataOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the AddTrainingDataOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the naturalLanguageQuery. - * - * @param naturalLanguageQuery the naturalLanguageQuery - * @return the AddTrainingDataOptions builder - */ - public Builder naturalLanguageQuery(String naturalLanguageQuery) { - this.naturalLanguageQuery = naturalLanguageQuery; - return this; - } - - /** - * Set the filter. - * - * @param filter the filter - * @return the AddTrainingDataOptions builder - */ - public Builder filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set the examples. Existing examples will be replaced. - * - * @param examples the examples - * @return the AddTrainingDataOptions builder - */ - public Builder examples(List examples) { - this.examples = examples; - return this; - } - } - - protected AddTrainingDataOptions() {} - - protected AddTrainingDataOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - naturalLanguageQuery = builder.naturalLanguageQuery; - filter = builder.filter; - examples = builder.examples; - } - - /** - * New builder. - * - * @return a AddTrainingDataOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the naturalLanguageQuery. - * - *

The natural text query for the new training query. - * - * @return the naturalLanguageQuery - */ - public String naturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the filter. - * - *

The filter used on the collection before the **natural_language_query** is applied. - * - * @return the filter - */ - public String filter() { - return filter; - } - - /** - * Gets the examples. - * - *

Array of training examples. - * - * @return the examples - */ - public List examples() { - return examples; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AggregationResult.java deleted file mode 100644 index 47fa2ad05cb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/AggregationResult.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Aggregation results for the specified query. */ -public class AggregationResult extends GenericModel { - - protected String key; - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List aggregations; - - /** - * Gets the key. - * - *

Key that matched the aggregation type. - * - * @return the key - */ - public String getKey() { - return key; - } - - /** - * Gets the matchingResults. - * - *

Number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the aggregations. - * - *

Aggregations returned in the case of chained aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Collection.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Collection.java deleted file mode 100644 index 748637f5712..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Collection.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** A collection for storing documents. */ -public class Collection extends GenericModel { - - /** The status of the collection. */ - public interface Status { - /** active. */ - String ACTIVE = "active"; - /** pending. */ - String PENDING = "pending"; - /** maintenance. */ - String MAINTENANCE = "maintenance"; - } - - @SerializedName("collection_id") - protected String collectionId; - - protected String name; - protected String description; - protected Date created; - protected Date updated; - protected String status; - - @SerializedName("configuration_id") - protected String configurationId; - - protected String language; - - @SerializedName("document_counts") - protected DocumentCounts documentCounts; - - @SerializedName("disk_usage") - protected CollectionDiskUsage diskUsage; - - @SerializedName("training_status") - protected TrainingStatus trainingStatus; - - @SerializedName("crawl_status") - protected CollectionCrawlStatus crawlStatus; - - @SerializedName("smart_document_understanding") - protected SduStatus smartDocumentUnderstanding; - - protected Collection() {} - - /** - * Gets the collectionId. - * - *

The unique identifier of the collection. - * - * @return the collectionId - */ - public String getCollectionId() { - return collectionId; - } - - /** - * Gets the name. - * - *

The name of the collection. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the description. - * - *

The description of the collection. - * - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * Gets the created. - * - *

The creation date of the collection in the format yyyy-MM-dd'T'HH:mmcon:ss.SSS'Z'. - * - * @return the created - */ - public Date getCreated() { - return created; - } - - /** - * Gets the updated. - * - *

The timestamp of when the collection was last updated in the format - * yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - * - * @return the updated - */ - public Date getUpdated() { - return updated; - } - - /** - * Gets the status. - * - *

The status of the collection. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the configurationId. - * - *

The unique identifier of the collection's configuration. - * - * @return the configurationId - */ - public String getConfigurationId() { - return configurationId; - } - - /** - * Gets the language. - * - *

The language of the documents stored in the collection. Permitted values include `en` - * (English), `de` (German), and `es` (Spanish). - * - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * Gets the documentCounts. - * - *

Object containing collection document count information. - * - * @return the documentCounts - */ - public DocumentCounts getDocumentCounts() { - return documentCounts; - } - - /** - * Gets the diskUsage. - * - *

Summary of the disk usage statistics for this collection. - * - * @return the diskUsage - */ - public CollectionDiskUsage getDiskUsage() { - return diskUsage; - } - - /** - * Gets the trainingStatus. - * - *

Training status details. - * - * @return the trainingStatus - */ - public TrainingStatus getTrainingStatus() { - return trainingStatus; - } - - /** - * Gets the crawlStatus. - * - *

Object containing information about the crawl status of this collection. - * - * @return the crawlStatus - */ - public CollectionCrawlStatus getCrawlStatus() { - return crawlStatus; - } - - /** - * Gets the smartDocumentUnderstanding. - * - *

Object containing smart document understanding information for this collection. - * - * @return the smartDocumentUnderstanding - */ - public SduStatus getSmartDocumentUnderstanding() { - return smartDocumentUnderstanding; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionUsage.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionUsage.java deleted file mode 100644 index a71d4adc2b4..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CollectionUsage.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Summary of the collection usage in the environment. */ -public class CollectionUsage extends GenericModel { - - protected Long available; - - @SerializedName("maximum_allowed") - protected Long maximumAllowed; - - protected CollectionUsage() {} - - /** - * Gets the available. - * - *

Number of active collections in the environment. - * - * @return the available - */ - public Long getAvailable() { - return available; - } - - /** - * Gets the maximumAllowed. - * - *

Total number of collections allowed in the environment. - * - * @return the maximumAllowed - */ - public Long getMaximumAllowed() { - return maximumAllowed; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Configuration.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Configuration.java deleted file mode 100644 index 7d468e249cc..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Configuration.java +++ /dev/null @@ -1,298 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** A custom configuration for the environment. */ -public class Configuration extends GenericModel { - - @SerializedName("configuration_id") - protected String configurationId; - - protected String name; - protected Date created; - protected Date updated; - protected String description; - protected Conversions conversions; - protected List enrichments; - protected List normalizations; - protected Source source; - - /** Builder. */ - public static class Builder { - private String name; - private String description; - private Conversions conversions; - private List enrichments; - private List normalizations; - private Source source; - - /** - * Instantiates a new Builder from an existing Configuration instance. - * - * @param configuration the instance to initialize the Builder with - */ - private Builder(Configuration configuration) { - this.name = configuration.name; - this.description = configuration.description; - this.conversions = configuration.conversions; - this.enrichments = configuration.enrichments; - this.normalizations = configuration.normalizations; - this.source = configuration.source; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param name the name - */ - public Builder(String name) { - this.name = name; - } - - /** - * Builds a Configuration. - * - * @return the new Configuration instance - */ - public Configuration build() { - return new Configuration(this); - } - - /** - * Adds a new element to enrichments. - * - * @param enrichment the new element to be added - * @return the Configuration builder - */ - public Builder addEnrichment(Enrichment enrichment) { - com.ibm.cloud.sdk.core.util.Validator.notNull(enrichment, "enrichment cannot be null"); - if (this.enrichments == null) { - this.enrichments = new ArrayList(); - } - this.enrichments.add(enrichment); - return this; - } - - /** - * Adds a new element to normalizations. - * - * @param normalization the new element to be added - * @return the Configuration builder - */ - public Builder addNormalization(NormalizationOperation normalization) { - com.ibm.cloud.sdk.core.util.Validator.notNull(normalization, "normalization cannot be null"); - if (this.normalizations == null) { - this.normalizations = new ArrayList(); - } - this.normalizations.add(normalization); - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the Configuration builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the Configuration builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the conversions. - * - * @param conversions the conversions - * @return the Configuration builder - */ - public Builder conversions(Conversions conversions) { - this.conversions = conversions; - return this; - } - - /** - * Set the enrichments. Existing enrichments will be replaced. - * - * @param enrichments the enrichments - * @return the Configuration builder - */ - public Builder enrichments(List enrichments) { - this.enrichments = enrichments; - return this; - } - - /** - * Set the normalizations. Existing normalizations will be replaced. - * - * @param normalizations the normalizations - * @return the Configuration builder - */ - public Builder normalizations(List normalizations) { - this.normalizations = normalizations; - return this; - } - - /** - * Set the source. - * - * @param source the source - * @return the Configuration builder - */ - public Builder source(Source source) { - this.source = source; - return this; - } - } - - protected Configuration() {} - - protected Configuration(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - name = builder.name; - description = builder.description; - conversions = builder.conversions; - enrichments = builder.enrichments; - normalizations = builder.normalizations; - source = builder.source; - } - - /** - * New builder. - * - * @return a Configuration builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the configurationId. - * - *

The unique identifier of the configuration. - * - * @return the configurationId - */ - public String configurationId() { - return configurationId; - } - - /** - * Gets the name. - * - *

The name of the configuration. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the created. - * - *

The creation date of the configuration in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - * - * @return the created - */ - public Date created() { - return created; - } - - /** - * Gets the updated. - * - *

The timestamp of when the configuration was last updated in the format - * yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - * - * @return the updated - */ - public Date updated() { - return updated; - } - - /** - * Gets the description. - * - *

The description of the configuration, if available. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the conversions. - * - *

Document conversion settings. - * - * @return the conversions - */ - public Conversions conversions() { - return conversions; - } - - /** - * Gets the enrichments. - * - *

An array of document enrichment settings for the configuration. - * - * @return the enrichments - */ - public List enrichments() { - return enrichments; - } - - /** - * Gets the normalizations. - * - *

Defines operations that can be used to transform the final output JSON into a normalized - * form. Operations are executed in the order that they appear in the array. - * - * @return the normalizations - */ - public List normalizations() { - return normalizations; - } - - /** - * Gets the source. - * - *

Object containing source parameters for the configuration. - * - * @return the source - */ - public Source source() { - return source; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Conversions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Conversions.java deleted file mode 100644 index 429778a2c20..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Conversions.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** Document conversion settings. */ -public class Conversions extends GenericModel { - - protected PdfSettings pdf; - protected WordSettings word; - protected HtmlSettings html; - protected SegmentSettings segment; - - @SerializedName("json_normalizations") - protected List jsonNormalizations; - - @SerializedName("image_text_recognition") - protected Boolean imageTextRecognition; - - /** Builder. */ - public static class Builder { - private PdfSettings pdf; - private WordSettings word; - private HtmlSettings html; - private SegmentSettings segment; - private List jsonNormalizations; - private Boolean imageTextRecognition; - - /** - * Instantiates a new Builder from an existing Conversions instance. - * - * @param conversions the instance to initialize the Builder with - */ - private Builder(Conversions conversions) { - this.pdf = conversions.pdf; - this.word = conversions.word; - this.html = conversions.html; - this.segment = conversions.segment; - this.jsonNormalizations = conversions.jsonNormalizations; - this.imageTextRecognition = conversions.imageTextRecognition; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a Conversions. - * - * @return the new Conversions instance - */ - public Conversions build() { - return new Conversions(this); - } - - /** - * Adds a new element to jsonNormalizations. - * - * @param normalization the new element to be added - * @return the Conversions builder - */ - public Builder addNormalization(NormalizationOperation normalization) { - com.ibm.cloud.sdk.core.util.Validator.notNull(normalization, "normalization cannot be null"); - if (this.jsonNormalizations == null) { - this.jsonNormalizations = new ArrayList(); - } - this.jsonNormalizations.add(normalization); - return this; - } - - /** - * Set the pdf. - * - * @param pdf the pdf - * @return the Conversions builder - */ - public Builder pdf(PdfSettings pdf) { - this.pdf = pdf; - return this; - } - - /** - * Set the word. - * - * @param word the word - * @return the Conversions builder - */ - public Builder word(WordSettings word) { - this.word = word; - return this; - } - - /** - * Set the html. - * - * @param html the html - * @return the Conversions builder - */ - public Builder html(HtmlSettings html) { - this.html = html; - return this; - } - - /** - * Set the segment. - * - * @param segment the segment - * @return the Conversions builder - */ - public Builder segment(SegmentSettings segment) { - this.segment = segment; - return this; - } - - /** - * Set the jsonNormalizations. Existing jsonNormalizations will be replaced. - * - * @param jsonNormalizations the jsonNormalizations - * @return the Conversions builder - */ - public Builder jsonNormalizations(List jsonNormalizations) { - this.jsonNormalizations = jsonNormalizations; - return this; - } - - /** - * Set the imageTextRecognition. - * - * @param imageTextRecognition the imageTextRecognition - * @return the Conversions builder - */ - public Builder imageTextRecognition(Boolean imageTextRecognition) { - this.imageTextRecognition = imageTextRecognition; - return this; - } - } - - protected Conversions() {} - - protected Conversions(Builder builder) { - pdf = builder.pdf; - word = builder.word; - html = builder.html; - segment = builder.segment; - jsonNormalizations = builder.jsonNormalizations; - imageTextRecognition = builder.imageTextRecognition; - } - - /** - * New builder. - * - * @return a Conversions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the pdf. - * - *

A list of PDF conversion settings. - * - * @return the pdf - */ - public PdfSettings pdf() { - return pdf; - } - - /** - * Gets the word. - * - *

A list of Word conversion settings. - * - * @return the word - */ - public WordSettings word() { - return word; - } - - /** - * Gets the html. - * - *

A list of HTML conversion settings. - * - * @return the html - */ - public HtmlSettings html() { - return html; - } - - /** - * Gets the segment. - * - *

A list of Document Segmentation settings. - * - * @return the segment - */ - public SegmentSettings segment() { - return segment; - } - - /** - * Gets the jsonNormalizations. - * - *

Defines operations that can be used to transform the final output JSON into a normalized - * form. Operations are executed in the order that they appear in the array. - * - * @return the jsonNormalizations - */ - public List jsonNormalizations() { - return jsonNormalizations; - } - - /** - * Gets the imageTextRecognition. - * - *

When `true`, automatic text extraction from images (this includes images embedded in - * supported document formats, for example PDF, and suppported image formats, for example TIFF) is - * performed on documents uploaded to the collection. This field is supported on **Advanced** and - * higher plans only. **Lite** plans do not support image text recognition. - * - * @return the imageTextRecognition - */ - public Boolean imageTextRecognition() { - return imageTextRecognition; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptions.java deleted file mode 100644 index a935d730699..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptions.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The createCollection options. */ -public class CreateCollectionOptions extends GenericModel { - - /** - * The language of the documents stored in the collection, in the form of an ISO 639-1 language - * code. - */ - public interface Language { - /** en. */ - String EN = "en"; - /** es. */ - String ES = "es"; - /** de. */ - String DE = "de"; - /** ar. */ - String AR = "ar"; - /** fr. */ - String FR = "fr"; - /** it. */ - String IT = "it"; - /** ja. */ - String JA = "ja"; - /** ko. */ - String KO = "ko"; - /** pt. */ - String PT = "pt"; - /** nl. */ - String NL = "nl"; - /** zh-CN. */ - String ZH_CN = "zh-CN"; - } - - protected String environmentId; - protected String name; - protected String description; - protected String configurationId; - protected String language; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String name; - private String description; - private String configurationId; - private String language; - - /** - * Instantiates a new Builder from an existing CreateCollectionOptions instance. - * - * @param createCollectionOptions the instance to initialize the Builder with - */ - private Builder(CreateCollectionOptions createCollectionOptions) { - this.environmentId = createCollectionOptions.environmentId; - this.name = createCollectionOptions.name; - this.description = createCollectionOptions.description; - this.configurationId = createCollectionOptions.configurationId; - this.language = createCollectionOptions.language; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param name the name - */ - public Builder(String environmentId, String name) { - this.environmentId = environmentId; - this.name = name; - } - - /** - * Builds a CreateCollectionOptions. - * - * @return the new CreateCollectionOptions instance - */ - public CreateCollectionOptions build() { - return new CreateCollectionOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateCollectionOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the CreateCollectionOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the CreateCollectionOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the configurationId. - * - * @param configurationId the configurationId - * @return the CreateCollectionOptions builder - */ - public Builder configurationId(String configurationId) { - this.configurationId = configurationId; - return this; - } - - /** - * Set the language. - * - * @param language the language - * @return the CreateCollectionOptions builder - */ - public Builder language(String language) { - this.language = language; - return this; - } - } - - protected CreateCollectionOptions() {} - - protected CreateCollectionOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - environmentId = builder.environmentId; - name = builder.name; - description = builder.description; - configurationId = builder.configurationId; - language = builder.language; - } - - /** - * New builder. - * - * @return a CreateCollectionOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

The name of the collection to be created. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - *

A description of the collection. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the configurationId. - * - *

The ID of the configuration in which the collection is to be created. - * - * @return the configurationId - */ - public String configurationId() { - return configurationId; - } - - /** - * Gets the language. - * - *

The language of the documents stored in the collection, in the form of an ISO 639-1 language - * code. - * - * @return the language - */ - public String language() { - return language; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptions.java deleted file mode 100644 index 60345831170..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptions.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The createConfiguration options. */ -public class CreateConfigurationOptions extends GenericModel { - - protected String environmentId; - protected String name; - protected String description; - protected Conversions conversions; - protected List enrichments; - protected List normalizations; - protected Source source; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String name; - private String description; - private Conversions conversions; - private List enrichments; - private List normalizations; - private Source source; - - /** - * Instantiates a new Builder from an existing CreateConfigurationOptions instance. - * - * @param createConfigurationOptions the instance to initialize the Builder with - */ - private Builder(CreateConfigurationOptions createConfigurationOptions) { - this.environmentId = createConfigurationOptions.environmentId; - this.name = createConfigurationOptions.name; - this.description = createConfigurationOptions.description; - this.conversions = createConfigurationOptions.conversions; - this.enrichments = createConfigurationOptions.enrichments; - this.normalizations = createConfigurationOptions.normalizations; - this.source = createConfigurationOptions.source; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param name the name - */ - public Builder(String environmentId, String name) { - this.environmentId = environmentId; - this.name = name; - } - - /** - * Builds a CreateConfigurationOptions. - * - * @return the new CreateConfigurationOptions instance - */ - public CreateConfigurationOptions build() { - return new CreateConfigurationOptions(this); - } - - /** - * Adds a new element to enrichments. - * - * @param enrichment the new element to be added - * @return the CreateConfigurationOptions builder - */ - public Builder addEnrichment(Enrichment enrichment) { - com.ibm.cloud.sdk.core.util.Validator.notNull(enrichment, "enrichment cannot be null"); - if (this.enrichments == null) { - this.enrichments = new ArrayList(); - } - this.enrichments.add(enrichment); - return this; - } - - /** - * Adds a new element to normalizations. - * - * @param normalization the new element to be added - * @return the CreateConfigurationOptions builder - */ - public Builder addNormalization(NormalizationOperation normalization) { - com.ibm.cloud.sdk.core.util.Validator.notNull(normalization, "normalization cannot be null"); - if (this.normalizations == null) { - this.normalizations = new ArrayList(); - } - this.normalizations.add(normalization); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateConfigurationOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the CreateConfigurationOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the CreateConfigurationOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the conversions. - * - * @param conversions the conversions - * @return the CreateConfigurationOptions builder - */ - public Builder conversions(Conversions conversions) { - this.conversions = conversions; - return this; - } - - /** - * Set the enrichments. Existing enrichments will be replaced. - * - * @param enrichments the enrichments - * @return the CreateConfigurationOptions builder - */ - public Builder enrichments(List enrichments) { - this.enrichments = enrichments; - return this; - } - - /** - * Set the normalizations. Existing normalizations will be replaced. - * - * @param normalizations the normalizations - * @return the CreateConfigurationOptions builder - */ - public Builder normalizations(List normalizations) { - this.normalizations = normalizations; - return this; - } - - /** - * Set the source. - * - * @param source the source - * @return the CreateConfigurationOptions builder - */ - public Builder source(Source source) { - this.source = source; - return this; - } - - /** - * Set the configuration. - * - * @param configuration the configuration - * @return the CreateConfigurationOptions builder - */ - public Builder configuration(Configuration configuration) { - this.name = configuration.name(); - this.description = configuration.description(); - this.conversions = configuration.conversions(); - this.enrichments = configuration.enrichments(); - this.normalizations = configuration.normalizations(); - this.source = configuration.source(); - return this; - } - } - - protected CreateConfigurationOptions() {} - - protected CreateConfigurationOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - environmentId = builder.environmentId; - name = builder.name; - description = builder.description; - conversions = builder.conversions; - enrichments = builder.enrichments; - normalizations = builder.normalizations; - source = builder.source; - } - - /** - * New builder. - * - * @return a CreateConfigurationOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

The name of the configuration. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - *

The description of the configuration, if available. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the conversions. - * - *

Document conversion settings. - * - * @return the conversions - */ - public Conversions conversions() { - return conversions; - } - - /** - * Gets the enrichments. - * - *

An array of document enrichment settings for the configuration. - * - * @return the enrichments - */ - public List enrichments() { - return enrichments; - } - - /** - * Gets the normalizations. - * - *

Defines operations that can be used to transform the final output JSON into a normalized - * form. Operations are executed in the order that they appear in the array. - * - * @return the normalizations - */ - public List normalizations() { - return normalizations; - } - - /** - * Gets the source. - * - *

Object containing source parameters for the configuration. - * - * @return the source - */ - public Source source() { - return source; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptions.java deleted file mode 100644 index 5ca84b44209..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptions.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The createCredentials options. */ -public class CreateCredentialsOptions extends GenericModel { - - /** - * The source that this credentials object connects to. - `box` indicates the credentials are used - * to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to - * connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to - * Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web - * crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud - * Object Store. - */ - public interface SourceType { - /** box. */ - String BOX = "box"; - /** salesforce. */ - String SALESFORCE = "salesforce"; - /** sharepoint. */ - String SHAREPOINT = "sharepoint"; - /** web_crawl. */ - String WEB_CRAWL = "web_crawl"; - /** cloud_object_storage. */ - String CLOUD_OBJECT_STORAGE = "cloud_object_storage"; - } - - protected String environmentId; - protected String sourceType; - protected CredentialDetails credentialDetails; - protected StatusDetails status; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String sourceType; - private CredentialDetails credentialDetails; - private StatusDetails status; - - /** - * Instantiates a new Builder from an existing CreateCredentialsOptions instance. - * - * @param createCredentialsOptions the instance to initialize the Builder with - */ - private Builder(CreateCredentialsOptions createCredentialsOptions) { - this.environmentId = createCredentialsOptions.environmentId; - this.sourceType = createCredentialsOptions.sourceType; - this.credentialDetails = createCredentialsOptions.credentialDetails; - this.status = createCredentialsOptions.status; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a CreateCredentialsOptions. - * - * @return the new CreateCredentialsOptions instance - */ - public CreateCredentialsOptions build() { - return new CreateCredentialsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateCredentialsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the sourceType. - * - * @param sourceType the sourceType - * @return the CreateCredentialsOptions builder - */ - public Builder sourceType(String sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Set the credentialDetails. - * - * @param credentialDetails the credentialDetails - * @return the CreateCredentialsOptions builder - */ - public Builder credentialDetails(CredentialDetails credentialDetails) { - this.credentialDetails = credentialDetails; - return this; - } - - /** - * Set the status. - * - * @param status the status - * @return the CreateCredentialsOptions builder - */ - public Builder status(StatusDetails status) { - this.status = status; - return this; - } - - /** - * Set the credentials. - * - * @param credentials the credentials - * @return the CreateCredentialsOptions builder - */ - public Builder credentials(Credentials credentials) { - this.sourceType = credentials.sourceType(); - this.credentialDetails = credentials.credentialDetails(); - this.status = credentials.status(); - return this; - } - } - - protected CreateCredentialsOptions() {} - - protected CreateCredentialsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - sourceType = builder.sourceType; - credentialDetails = builder.credentialDetails; - status = builder.status; - } - - /** - * New builder. - * - * @return a CreateCredentialsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the sourceType. - * - *

The source that this credentials object connects to. - `box` indicates the credentials are - * used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are - * used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to - * Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web - * crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud - * Object Store. - * - * @return the sourceType - */ - public String sourceType() { - return sourceType; - } - - /** - * Gets the credentialDetails. - * - *

Object containing details of the stored credentials. - * - *

Obtain credentials for your source from the administrator of the source. - * - * @return the credentialDetails - */ - public CredentialDetails credentialDetails() { - return credentialDetails; - } - - /** - * Gets the status. - * - *

Object that contains details about the status of the authentication process. - * - * @return the status - */ - public StatusDetails status() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptions.java deleted file mode 100644 index 07641b9f177..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEnvironmentOptions.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The createEnvironment options. */ -public class CreateEnvironmentOptions extends GenericModel { - - /** - * Size of the environment. In the Lite plan the default and only accepted value is `LT`, in all - * other plans the default is `S`. - */ - public interface Size { - /** LT. */ - String LT = "LT"; - /** XS. */ - String XS = "XS"; - /** S. */ - String S = "S"; - /** MS. */ - String MS = "MS"; - /** M. */ - String M = "M"; - /** ML. */ - String ML = "ML"; - /** L. */ - String L = "L"; - /** XL. */ - String XL = "XL"; - /** XXL. */ - String XXL = "XXL"; - /** XXXL. */ - String XXXL = "XXXL"; - } - - protected String name; - protected String description; - protected String size; - - /** Builder. */ - public static class Builder { - private String name; - private String description; - private String size; - - /** - * Instantiates a new Builder from an existing CreateEnvironmentOptions instance. - * - * @param createEnvironmentOptions the instance to initialize the Builder with - */ - private Builder(CreateEnvironmentOptions createEnvironmentOptions) { - this.name = createEnvironmentOptions.name; - this.description = createEnvironmentOptions.description; - this.size = createEnvironmentOptions.size; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param name the name - */ - public Builder(String name) { - this.name = name; - } - - /** - * Builds a CreateEnvironmentOptions. - * - * @return the new CreateEnvironmentOptions instance - */ - public CreateEnvironmentOptions build() { - return new CreateEnvironmentOptions(this); - } - - /** - * Set the name. - * - * @param name the name - * @return the CreateEnvironmentOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the CreateEnvironmentOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the size. - * - * @param size the size - * @return the CreateEnvironmentOptions builder - */ - public Builder size(String size) { - this.size = size; - return this; - } - } - - protected CreateEnvironmentOptions() {} - - protected CreateEnvironmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - name = builder.name; - description = builder.description; - size = builder.size; - } - - /** - * New builder. - * - * @return a CreateEnvironmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the name. - * - *

Name that identifies the environment. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - *

Description of the environment. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the size. - * - *

Size of the environment. In the Lite plan the default and only accepted value is `LT`, in - * all other plans the default is `S`. - * - * @return the size - */ - public String size() { - return size; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventOptions.java deleted file mode 100644 index ae055f13d5c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventOptions.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The createEvent options. */ -public class CreateEventOptions extends GenericModel { - - /** The event type to be created. */ - public interface Type { - /** click. */ - String CLICK = "click"; - } - - protected String type; - protected EventData data; - - /** Builder. */ - public static class Builder { - private String type; - private EventData data; - - /** - * Instantiates a new Builder from an existing CreateEventOptions instance. - * - * @param createEventOptions the instance to initialize the Builder with - */ - private Builder(CreateEventOptions createEventOptions) { - this.type = createEventOptions.type; - this.data = createEventOptions.data; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param type the type - * @param data the data - */ - public Builder(String type, EventData data) { - this.type = type; - this.data = data; - } - - /** - * Builds a CreateEventOptions. - * - * @return the new CreateEventOptions instance - */ - public CreateEventOptions build() { - return new CreateEventOptions(this); - } - - /** - * Set the type. - * - * @param type the type - * @return the CreateEventOptions builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Set the data. - * - * @param data the data - * @return the CreateEventOptions builder - */ - public Builder data(EventData data) { - this.data = data; - return this; - } - } - - protected CreateEventOptions() {} - - protected CreateEventOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.type, "type cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.data, "data cannot be null"); - type = builder.type; - data = builder.data; - } - - /** - * New builder. - * - * @return a CreateEventOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the type. - * - *

The event type to be created. - * - * @return the type - */ - public String type() { - return type; - } - - /** - * Gets the data. - * - *

Query event data object. - * - * @return the data - */ - public EventData data() { - return data; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventResponse.java deleted file mode 100644 index 15ad5a2adfb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateEventResponse.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object defining the event being created. */ -public class CreateEventResponse extends GenericModel { - - /** The event type that was created. */ - public interface Type { - /** click. */ - String CLICK = "click"; - } - - protected String type; - protected EventData data; - - protected CreateEventResponse() {} - - /** - * Gets the type. - * - *

The event type that was created. - * - * @return the type - */ - public String getType() { - return type; - } - - /** - * Gets the data. - * - *

Query event data object. - * - * @return the data - */ - public EventData getData() { - return data; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateExpansionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateExpansionsOptions.java deleted file mode 100644 index eedede7f9e3..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateExpansionsOptions.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The createExpansions options. */ -public class CreateExpansionsOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected List expansions; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private List expansions; - - /** - * Instantiates a new Builder from an existing CreateExpansionsOptions instance. - * - * @param createExpansionsOptions the instance to initialize the Builder with - */ - private Builder(CreateExpansionsOptions createExpansionsOptions) { - this.environmentId = createExpansionsOptions.environmentId; - this.collectionId = createExpansionsOptions.collectionId; - this.expansions = createExpansionsOptions.expansions; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param expansions the expansions - */ - public Builder(String environmentId, String collectionId, List expansions) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.expansions = expansions; - } - - /** - * Builds a CreateExpansionsOptions. - * - * @return the new CreateExpansionsOptions instance - */ - public CreateExpansionsOptions build() { - return new CreateExpansionsOptions(this); - } - - /** - * Adds a new element to expansions. - * - * @param expansions the new element to be added - * @return the CreateExpansionsOptions builder - */ - public Builder addExpansions(Expansion expansions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(expansions, "expansions cannot be null"); - if (this.expansions == null) { - this.expansions = new ArrayList(); - } - this.expansions.add(expansions); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateExpansionsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the CreateExpansionsOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the expansions. Existing expansions will be replaced. - * - * @param expansions the expansions - * @return the CreateExpansionsOptions builder - */ - public Builder expansions(List expansions) { - this.expansions = expansions; - return this; - } - - /** - * Set the expansions. - * - * @param expansions the expansions - * @return the CreateExpansionsOptions builder - */ - public Builder expansions(Expansions expansions) { - this.expansions = expansions.expansions(); - return this; - } - } - - protected CreateExpansionsOptions() {} - - protected CreateExpansionsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.expansions, "expansions cannot be null"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - expansions = builder.expansions; - } - - /** - * New builder. - * - * @return a CreateExpansionsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the expansions. - * - *

An array of query expansion definitions. - * - *

Each object in the **expansions** array represents a term or set of terms that will be - * expanded into other terms. Each expansion object can be configured as bidirectional or - * unidirectional. Bidirectional means that all terms are expanded to all other terms in the - * object. Unidirectional means that a set list of terms can be expanded into a second list of - * terms. - * - *

To create a bi-directional expansion specify an **expanded_terms** array. When found in a - * query, all items in the **expanded_terms** array are then expanded to the other items in the - * same array. - * - *

To create a uni-directional expansion, specify both an array of **input_terms** and an array - * of **expanded_terms**. When items in the **input_terms** array are present in a query, they are - * expanded using the items listed in the **expanded_terms** array. - * - * @return the expansions - */ - public List expansions() { - return expansions; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateGatewayOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateGatewayOptions.java deleted file mode 100644 index b7b0c94f6b5..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateGatewayOptions.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The createGateway options. */ -public class CreateGatewayOptions extends GenericModel { - - protected String environmentId; - protected String name; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String name; - - /** - * Instantiates a new Builder from an existing CreateGatewayOptions instance. - * - * @param createGatewayOptions the instance to initialize the Builder with - */ - private Builder(CreateGatewayOptions createGatewayOptions) { - this.environmentId = createGatewayOptions.environmentId; - this.name = createGatewayOptions.name; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a CreateGatewayOptions. - * - * @return the new CreateGatewayOptions instance - */ - public CreateGatewayOptions build() { - return new CreateGatewayOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateGatewayOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the CreateGatewayOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - } - - protected CreateGatewayOptions() {} - - protected CreateGatewayOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - name = builder.name; - } - - /** - * New builder. - * - * @return a CreateGatewayOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

User-defined name. - * - * @return the name - */ - public String name() { - return name; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateStopwordListOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateStopwordListOptions.java deleted file mode 100644 index bd8de9d527c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateStopwordListOptions.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -/** The createStopwordList options. */ -public class CreateStopwordListOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected InputStream stopwordFile; - protected String stopwordFilename; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private InputStream stopwordFile; - private String stopwordFilename; - - /** - * Instantiates a new Builder from an existing CreateStopwordListOptions instance. - * - * @param createStopwordListOptions the instance to initialize the Builder with - */ - private Builder(CreateStopwordListOptions createStopwordListOptions) { - this.environmentId = createStopwordListOptions.environmentId; - this.collectionId = createStopwordListOptions.collectionId; - this.stopwordFile = createStopwordListOptions.stopwordFile; - this.stopwordFilename = createStopwordListOptions.stopwordFilename; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param stopwordFile the stopwordFile - * @param stopwordFilename the stopwordFilename - */ - public Builder( - String environmentId, - String collectionId, - InputStream stopwordFile, - String stopwordFilename) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.stopwordFile = stopwordFile; - this.stopwordFilename = stopwordFilename; - } - - /** - * Builds a CreateStopwordListOptions. - * - * @return the new CreateStopwordListOptions instance - */ - public CreateStopwordListOptions build() { - return new CreateStopwordListOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateStopwordListOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the CreateStopwordListOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the stopwordFile. - * - * @param stopwordFile the stopwordFile - * @return the CreateStopwordListOptions builder - */ - public Builder stopwordFile(InputStream stopwordFile) { - this.stopwordFile = stopwordFile; - return this; - } - - /** - * Set the stopwordFilename. - * - * @param stopwordFilename the stopwordFilename - * @return the CreateStopwordListOptions builder - */ - public Builder stopwordFilename(String stopwordFilename) { - this.stopwordFilename = stopwordFilename; - return this; - } - - /** - * Set the stopwordFile. - * - * @param stopwordFile the stopwordFile - * @return the CreateStopwordListOptions builder - * @throws FileNotFoundException if the file could not be found - */ - public Builder stopwordFile(File stopwordFile) throws FileNotFoundException { - this.stopwordFile = new FileInputStream(stopwordFile); - this.stopwordFilename = stopwordFile.getName(); - return this; - } - } - - protected CreateStopwordListOptions() {} - - protected CreateStopwordListOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.stopwordFile, "stopwordFile cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.stopwordFilename, "stopwordFilename cannot be null"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - stopwordFile = builder.stopwordFile; - stopwordFilename = builder.stopwordFilename; - } - - /** - * New builder. - * - * @return a CreateStopwordListOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the stopwordFile. - * - *

The content of the stopword list to ingest. - * - * @return the stopwordFile - */ - public InputStream stopwordFile() { - return stopwordFile; - } - - /** - * Gets the stopwordFilename. - * - *

The filename for stopwordFile. - * - * @return the stopwordFilename - */ - public String stopwordFilename() { - return stopwordFilename; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateTokenizationDictionaryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateTokenizationDictionaryOptions.java deleted file mode 100644 index 72dc5d3c715..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateTokenizationDictionaryOptions.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The createTokenizationDictionary options. */ -public class CreateTokenizationDictionaryOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected List tokenizationRules; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private List tokenizationRules; - - /** - * Instantiates a new Builder from an existing CreateTokenizationDictionaryOptions instance. - * - * @param createTokenizationDictionaryOptions the instance to initialize the Builder with - */ - private Builder(CreateTokenizationDictionaryOptions createTokenizationDictionaryOptions) { - this.environmentId = createTokenizationDictionaryOptions.environmentId; - this.collectionId = createTokenizationDictionaryOptions.collectionId; - this.tokenizationRules = createTokenizationDictionaryOptions.tokenizationRules; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a CreateTokenizationDictionaryOptions. - * - * @return the new CreateTokenizationDictionaryOptions instance - */ - public CreateTokenizationDictionaryOptions build() { - return new CreateTokenizationDictionaryOptions(this); - } - - /** - * Adds a new element to tokenizationRules. - * - * @param tokenizationRules the new element to be added - * @return the CreateTokenizationDictionaryOptions builder - */ - public Builder addTokenizationRules(TokenDictRule tokenizationRules) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - tokenizationRules, "tokenizationRules cannot be null"); - if (this.tokenizationRules == null) { - this.tokenizationRules = new ArrayList(); - } - this.tokenizationRules.add(tokenizationRules); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateTokenizationDictionaryOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the CreateTokenizationDictionaryOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the tokenizationRules. Existing tokenizationRules will be replaced. - * - * @param tokenizationRules the tokenizationRules - * @return the CreateTokenizationDictionaryOptions builder - */ - public Builder tokenizationRules(List tokenizationRules) { - this.tokenizationRules = tokenizationRules; - return this; - } - } - - protected CreateTokenizationDictionaryOptions() {} - - protected CreateTokenizationDictionaryOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - tokenizationRules = builder.tokenizationRules; - } - - /** - * New builder. - * - * @return a CreateTokenizationDictionaryOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the tokenizationRules. - * - *

An array of tokenization rules. Each rule contains, the original `text` string, component - * `tokens`, any alternate character set `readings`, and which `part_of_speech` the text is from. - * - * @return the tokenizationRules - */ - public List tokenizationRules() { - return tokenizationRules; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateTrainingExampleOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateTrainingExampleOptions.java deleted file mode 100644 index 50c06254b5a..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CreateTrainingExampleOptions.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The createTrainingExample options. */ -public class CreateTrainingExampleOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - protected String documentId; - protected String crossReference; - protected Long relevance; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - private String documentId; - private String crossReference; - private Long relevance; - - /** - * Instantiates a new Builder from an existing CreateTrainingExampleOptions instance. - * - * @param createTrainingExampleOptions the instance to initialize the Builder with - */ - private Builder(CreateTrainingExampleOptions createTrainingExampleOptions) { - this.environmentId = createTrainingExampleOptions.environmentId; - this.collectionId = createTrainingExampleOptions.collectionId; - this.queryId = createTrainingExampleOptions.queryId; - this.documentId = createTrainingExampleOptions.documentId; - this.crossReference = createTrainingExampleOptions.crossReference; - this.relevance = createTrainingExampleOptions.relevance; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - */ - public Builder(String environmentId, String collectionId, String queryId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - } - - /** - * Builds a CreateTrainingExampleOptions. - * - * @return the new CreateTrainingExampleOptions instance - */ - public CreateTrainingExampleOptions build() { - return new CreateTrainingExampleOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the CreateTrainingExampleOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the CreateTrainingExampleOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the CreateTrainingExampleOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the CreateTrainingExampleOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - - /** - * Set the crossReference. - * - * @param crossReference the crossReference - * @return the CreateTrainingExampleOptions builder - */ - public Builder crossReference(String crossReference) { - this.crossReference = crossReference; - return this; - } - - /** - * Set the relevance. - * - * @param relevance the relevance - * @return the CreateTrainingExampleOptions builder - */ - public Builder relevance(long relevance) { - this.relevance = relevance; - return this; - } - - /** - * Set the trainingExample. - * - * @param trainingExample the trainingExample - * @return the CreateTrainingExampleOptions builder - */ - public Builder trainingExample(TrainingExample trainingExample) { - this.documentId = trainingExample.documentId(); - this.crossReference = trainingExample.crossReference(); - this.relevance = trainingExample.relevance(); - return this; - } - } - - protected CreateTrainingExampleOptions() {} - - protected CreateTrainingExampleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - documentId = builder.documentId; - crossReference = builder.crossReference; - relevance = builder.relevance; - } - - /** - * New builder. - * - * @return a CreateTrainingExampleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } - - /** - * Gets the documentId. - * - *

The document ID associated with this training example. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } - - /** - * Gets the crossReference. - * - *

The cross reference associated with this training example. - * - * @return the crossReference - */ - public String crossReference() { - return crossReference; - } - - /** - * Gets the relevance. - * - *

The relevance of the training example. - * - * @return the relevance - */ - public Long relevance() { - return relevance; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialDetails.java deleted file mode 100644 index 0cce6cc5bde..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialDetails.java +++ /dev/null @@ -1,662 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Object containing details of the stored credentials. - * - *

Obtain credentials for your source from the administrator of the source. - */ -public class CredentialDetails extends GenericModel { - - /** - * The authentication method for this credentials definition. The **credential_type** specified - * must be supported by the **source_type**. The following combinations are possible: - * - *

- `"source_type": "box"` - valid `credential_type`s: `oauth2` - `"source_type": - * "salesforce"` - valid `credential_type`s: `username_password` - `"source_type": "sharepoint"` - - * valid `credential_type`s: `saml` with **source_version** of `online`, or `ntlm_v1` with - * **source_version** of `2016` - `"source_type": "web_crawl"` - valid `credential_type`s: - * `noauth` or `basic` - "source_type": "cloud_object_storage"` - valid `credential_type`s: - * `aws4_hmac`. - */ - public interface CredentialType { - /** oauth2. */ - String OAUTH2 = "oauth2"; - /** saml. */ - String SAML = "saml"; - /** username_password. */ - String USERNAME_PASSWORD = "username_password"; - /** noauth. */ - String NOAUTH = "noauth"; - /** basic. */ - String BASIC = "basic"; - /** ntlm_v1. */ - String NTLM_V1 = "ntlm_v1"; - /** aws4_hmac. */ - String AWS4_HMAC = "aws4_hmac"; - } - - /** - * The type of Sharepoint repository to connect to. Only valid, and required, with a - * **source_type** of `sharepoint`. - */ - public interface SourceVersion { - /** online. */ - String ONLINE = "online"; - } - - @SerializedName("credential_type") - protected String credentialType; - - @SerializedName("client_id") - protected String clientId; - - @SerializedName("enterprise_id") - protected String enterpriseId; - - protected String url; - protected String username; - - @SerializedName("organization_url") - protected String organizationUrl; - - @SerializedName("site_collection.path") - protected String siteCollectionPath; - - @SerializedName("client_secret") - protected String clientSecret; - - @SerializedName("public_key_id") - protected String publicKeyId; - - @SerializedName("private_key") - protected String privateKey; - - protected String passphrase; - protected String password; - - @SerializedName("gateway_id") - protected String gatewayId; - - @SerializedName("source_version") - protected String sourceVersion; - - @SerializedName("web_application_url") - protected String webApplicationUrl; - - protected String domain; - protected String endpoint; - - @SerializedName("access_key_id") - protected String accessKeyId; - - @SerializedName("secret_access_key") - protected String secretAccessKey; - - /** Builder. */ - public static class Builder { - private String credentialType; - private String clientId; - private String enterpriseId; - private String url; - private String username; - private String organizationUrl; - private String siteCollectionPath; - private String clientSecret; - private String publicKeyId; - private String privateKey; - private String passphrase; - private String password; - private String gatewayId; - private String sourceVersion; - private String webApplicationUrl; - private String domain; - private String endpoint; - private String accessKeyId; - private String secretAccessKey; - - /** - * Instantiates a new Builder from an existing CredentialDetails instance. - * - * @param credentialDetails the instance to initialize the Builder with - */ - private Builder(CredentialDetails credentialDetails) { - this.credentialType = credentialDetails.credentialType; - this.clientId = credentialDetails.clientId; - this.enterpriseId = credentialDetails.enterpriseId; - this.url = credentialDetails.url; - this.username = credentialDetails.username; - this.organizationUrl = credentialDetails.organizationUrl; - this.siteCollectionPath = credentialDetails.siteCollectionPath; - this.clientSecret = credentialDetails.clientSecret; - this.publicKeyId = credentialDetails.publicKeyId; - this.privateKey = credentialDetails.privateKey; - this.passphrase = credentialDetails.passphrase; - this.password = credentialDetails.password; - this.gatewayId = credentialDetails.gatewayId; - this.sourceVersion = credentialDetails.sourceVersion; - this.webApplicationUrl = credentialDetails.webApplicationUrl; - this.domain = credentialDetails.domain; - this.endpoint = credentialDetails.endpoint; - this.accessKeyId = credentialDetails.accessKeyId; - this.secretAccessKey = credentialDetails.secretAccessKey; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a CredentialDetails. - * - * @return the new CredentialDetails instance - */ - public CredentialDetails build() { - return new CredentialDetails(this); - } - - /** - * Set the credentialType. - * - * @param credentialType the credentialType - * @return the CredentialDetails builder - */ - public Builder credentialType(String credentialType) { - this.credentialType = credentialType; - return this; - } - - /** - * Set the clientId. - * - * @param clientId the clientId - * @return the CredentialDetails builder - */ - public Builder clientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Set the enterpriseId. - * - * @param enterpriseId the enterpriseId - * @return the CredentialDetails builder - */ - public Builder enterpriseId(String enterpriseId) { - this.enterpriseId = enterpriseId; - return this; - } - - /** - * Set the url. - * - * @param url the url - * @return the CredentialDetails builder - */ - public Builder url(String url) { - this.url = url; - return this; - } - - /** - * Set the username. - * - * @param username the username - * @return the CredentialDetails builder - */ - public Builder username(String username) { - this.username = username; - return this; - } - - /** - * Set the organizationUrl. - * - * @param organizationUrl the organizationUrl - * @return the CredentialDetails builder - */ - public Builder organizationUrl(String organizationUrl) { - this.organizationUrl = organizationUrl; - return this; - } - - /** - * Set the siteCollectionPath. - * - * @param siteCollectionPath the siteCollectionPath - * @return the CredentialDetails builder - */ - public Builder siteCollectionPath(String siteCollectionPath) { - this.siteCollectionPath = siteCollectionPath; - return this; - } - - /** - * Set the clientSecret. - * - * @param clientSecret the clientSecret - * @return the CredentialDetails builder - */ - public Builder clientSecret(String clientSecret) { - this.clientSecret = clientSecret; - return this; - } - - /** - * Set the publicKeyId. - * - * @param publicKeyId the publicKeyId - * @return the CredentialDetails builder - */ - public Builder publicKeyId(String publicKeyId) { - this.publicKeyId = publicKeyId; - return this; - } - - /** - * Set the privateKey. - * - * @param privateKey the privateKey - * @return the CredentialDetails builder - */ - public Builder privateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } - - /** - * Set the passphrase. - * - * @param passphrase the passphrase - * @return the CredentialDetails builder - */ - public Builder passphrase(String passphrase) { - this.passphrase = passphrase; - return this; - } - - /** - * Set the password. - * - * @param password the password - * @return the CredentialDetails builder - */ - public Builder password(String password) { - this.password = password; - return this; - } - - /** - * Set the gatewayId. - * - * @param gatewayId the gatewayId - * @return the CredentialDetails builder - */ - public Builder gatewayId(String gatewayId) { - this.gatewayId = gatewayId; - return this; - } - - /** - * Set the sourceVersion. - * - * @param sourceVersion the sourceVersion - * @return the CredentialDetails builder - */ - public Builder sourceVersion(String sourceVersion) { - this.sourceVersion = sourceVersion; - return this; - } - - /** - * Set the webApplicationUrl. - * - * @param webApplicationUrl the webApplicationUrl - * @return the CredentialDetails builder - */ - public Builder webApplicationUrl(String webApplicationUrl) { - this.webApplicationUrl = webApplicationUrl; - return this; - } - - /** - * Set the domain. - * - * @param domain the domain - * @return the CredentialDetails builder - */ - public Builder domain(String domain) { - this.domain = domain; - return this; - } - - /** - * Set the endpoint. - * - * @param endpoint the endpoint - * @return the CredentialDetails builder - */ - public Builder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /** - * Set the accessKeyId. - * - * @param accessKeyId the accessKeyId - * @return the CredentialDetails builder - */ - public Builder accessKeyId(String accessKeyId) { - this.accessKeyId = accessKeyId; - return this; - } - - /** - * Set the secretAccessKey. - * - * @param secretAccessKey the secretAccessKey - * @return the CredentialDetails builder - */ - public Builder secretAccessKey(String secretAccessKey) { - this.secretAccessKey = secretAccessKey; - return this; - } - } - - protected CredentialDetails() {} - - protected CredentialDetails(Builder builder) { - credentialType = builder.credentialType; - clientId = builder.clientId; - enterpriseId = builder.enterpriseId; - url = builder.url; - username = builder.username; - organizationUrl = builder.organizationUrl; - siteCollectionPath = builder.siteCollectionPath; - clientSecret = builder.clientSecret; - publicKeyId = builder.publicKeyId; - privateKey = builder.privateKey; - passphrase = builder.passphrase; - password = builder.password; - gatewayId = builder.gatewayId; - sourceVersion = builder.sourceVersion; - webApplicationUrl = builder.webApplicationUrl; - domain = builder.domain; - endpoint = builder.endpoint; - accessKeyId = builder.accessKeyId; - secretAccessKey = builder.secretAccessKey; - } - - /** - * New builder. - * - * @return a CredentialDetails builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the credentialType. - * - *

The authentication method for this credentials definition. The **credential_type** specified - * must be supported by the **source_type**. The following combinations are possible: - * - *

- `"source_type": "box"` - valid `credential_type`s: `oauth2` - `"source_type": - * "salesforce"` - valid `credential_type`s: `username_password` - `"source_type": "sharepoint"` - - * valid `credential_type`s: `saml` with **source_version** of `online`, or `ntlm_v1` with - * **source_version** of `2016` - `"source_type": "web_crawl"` - valid `credential_type`s: - * `noauth` or `basic` - "source_type": "cloud_object_storage"` - valid `credential_type`s: - * `aws4_hmac`. - * - * @return the credentialType - */ - public String credentialType() { - return credentialType; - } - - /** - * Gets the clientId. - * - *

The **client_id** of the source that these credentials connect to. Only valid, and required, - * with a **credential_type** of `oauth2`. - * - * @return the clientId - */ - public String clientId() { - return clientId; - } - - /** - * Gets the enterpriseId. - * - *

The **enterprise_id** of the Box site that these credentials connect to. Only valid, and - * required, with a **source_type** of `box`. - * - * @return the enterpriseId - */ - public String enterpriseId() { - return enterpriseId; - } - - /** - * Gets the url. - * - *

The **url** of the source that these credentials connect to. Only valid, and required, with - * a **credential_type** of `username_password`, `noauth`, and `basic`. - * - * @return the url - */ - public String url() { - return url; - } - - /** - * Gets the username. - * - *

The **username** of the source that these credentials connect to. Only valid, and required, - * with a **credential_type** of `saml`, `username_password`, `basic`, or `ntlm_v1`. - * - * @return the username - */ - public String username() { - return username; - } - - /** - * Gets the organizationUrl. - * - *

The **organization_url** of the source that these credentials connect to. Only valid, and - * required, with a **credential_type** of `saml`. - * - * @return the organizationUrl - */ - public String organizationUrl() { - return organizationUrl; - } - - /** - * Gets the siteCollectionPath. - * - *

The **site_collection.path** of the source that these credentials connect to. Only valid, - * and required, with a **source_type** of `sharepoint`. - * - * @return the siteCollectionPath - */ - public String siteCollectionPath() { - return siteCollectionPath; - } - - /** - * Gets the clientSecret. - * - *

The **client_secret** of the source that these credentials connect to. Only valid, and - * required, with a **credential_type** of `oauth2`. This value is never returned and is only used - * when creating or modifying **credentials**. - * - * @return the clientSecret - */ - public String clientSecret() { - return clientSecret; - } - - /** - * Gets the publicKeyId. - * - *

The **public_key_id** of the source that these credentials connect to. Only valid, and - * required, with a **credential_type** of `oauth2`. This value is never returned and is only used - * when creating or modifying **credentials**. - * - * @return the publicKeyId - */ - public String publicKeyId() { - return publicKeyId; - } - - /** - * Gets the privateKey. - * - *

The **private_key** of the source that these credentials connect to. Only valid, and - * required, with a **credential_type** of `oauth2`. This value is never returned and is only used - * when creating or modifying **credentials**. - * - * @return the privateKey - */ - public String privateKey() { - return privateKey; - } - - /** - * Gets the passphrase. - * - *

The **passphrase** of the source that these credentials connect to. Only valid, and - * required, with a **credential_type** of `oauth2`. This value is never returned and is only used - * when creating or modifying **credentials**. - * - * @return the passphrase - */ - public String passphrase() { - return passphrase; - } - - /** - * Gets the password. - * - *

The **password** of the source that these credentials connect to. Only valid, and required, - * with **credential_type**s of `saml`, `username_password`, `basic`, or `ntlm_v1`. - * - *

**Note:** When used with a **source_type** of `salesforce`, the password consists of the - * Salesforce password and a valid Salesforce security token concatenated. This value is never - * returned and is only used when creating or modifying **credentials**. - * - * @return the password - */ - public String password() { - return password; - } - - /** - * Gets the gatewayId. - * - *

The ID of the **gateway** to be connected through (when connecting to intranet sites). Only - * valid with a **credential_type** of `noauth`, `basic`, or `ntlm_v1`. Gateways are created using - * the `/v1/environments/{environment_id}/gateways` methods. - * - * @return the gatewayId - */ - public String gatewayId() { - return gatewayId; - } - - /** - * Gets the sourceVersion. - * - *

The type of Sharepoint repository to connect to. Only valid, and required, with a - * **source_type** of `sharepoint`. - * - * @return the sourceVersion - */ - public String sourceVersion() { - return sourceVersion; - } - - /** - * Gets the webApplicationUrl. - * - *

SharePoint OnPrem WebApplication URL. Only valid, and required, with a **source_version** of - * `2016`. If a port is not supplied, the default to port `80` for http and port `443` for https - * connections are used. - * - * @return the webApplicationUrl - */ - public String webApplicationUrl() { - return webApplicationUrl; - } - - /** - * Gets the domain. - * - *

The domain used to log in to your OnPrem SharePoint account. Only valid, and required, with - * a **source_version** of `2016`. - * - * @return the domain - */ - public String domain() { - return domain; - } - - /** - * Gets the endpoint. - * - *

The endpoint associated with the cloud object store that your are connecting to. Only valid, - * and required, with a **credential_type** of `aws4_hmac`. - * - * @return the endpoint - */ - public String endpoint() { - return endpoint; - } - - /** - * Gets the accessKeyId. - * - *

The access key ID associated with the cloud object store. Only valid, and required, with a - * **credential_type** of `aws4_hmac`. This value is never returned and is only used when creating - * or modifying **credentials**. For more infomation, see the [cloud object store - * documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-using-hmac-credentials#using-hmac-credentials). - * - * @return the accessKeyId - */ - public String accessKeyId() { - return accessKeyId; - } - - /** - * Gets the secretAccessKey. - * - *

The secret access key associated with the cloud object store. Only valid, and required, with - * a **credential_type** of `aws4_hmac`. This value is never returned and is only used when - * creating or modifying **credentials**. For more infomation, see the [cloud object store - * documentation](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-using-hmac-credentials#using-hmac-credentials). - * - * @return the secretAccessKey - */ - public String secretAccessKey() { - return secretAccessKey; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Credentials.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Credentials.java deleted file mode 100644 index f4096547008..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Credentials.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing credential information. */ -public class Credentials extends GenericModel { - - /** - * The source that this credentials object connects to. - `box` indicates the credentials are used - * to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to - * connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to - * Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web - * crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud - * Object Store. - */ - public interface SourceType { - /** box. */ - String BOX = "box"; - /** salesforce. */ - String SALESFORCE = "salesforce"; - /** sharepoint. */ - String SHAREPOINT = "sharepoint"; - /** web_crawl. */ - String WEB_CRAWL = "web_crawl"; - /** cloud_object_storage. */ - String CLOUD_OBJECT_STORAGE = "cloud_object_storage"; - } - - @SerializedName("credential_id") - protected String credentialId; - - @SerializedName("source_type") - protected String sourceType; - - @SerializedName("credential_details") - protected CredentialDetails credentialDetails; - - protected StatusDetails status; - - /** Builder. */ - public static class Builder { - private String sourceType; - private CredentialDetails credentialDetails; - private StatusDetails status; - - /** - * Instantiates a new Builder from an existing Credentials instance. - * - * @param credentials the instance to initialize the Builder with - */ - private Builder(Credentials credentials) { - this.sourceType = credentials.sourceType; - this.credentialDetails = credentials.credentialDetails; - this.status = credentials.status; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a Credentials. - * - * @return the new Credentials instance - */ - public Credentials build() { - return new Credentials(this); - } - - /** - * Set the sourceType. - * - * @param sourceType the sourceType - * @return the Credentials builder - */ - public Builder sourceType(String sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Set the credentialDetails. - * - * @param credentialDetails the credentialDetails - * @return the Credentials builder - */ - public Builder credentialDetails(CredentialDetails credentialDetails) { - this.credentialDetails = credentialDetails; - return this; - } - - /** - * Set the status. - * - * @param status the status - * @return the Credentials builder - */ - public Builder status(StatusDetails status) { - this.status = status; - return this; - } - } - - protected Credentials() {} - - protected Credentials(Builder builder) { - sourceType = builder.sourceType; - credentialDetails = builder.credentialDetails; - status = builder.status; - } - - /** - * New builder. - * - * @return a Credentials builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the credentialId. - * - *

Unique identifier for this set of credentials. - * - * @return the credentialId - */ - public String credentialId() { - return credentialId; - } - - /** - * Gets the sourceType. - * - *

The source that this credentials object connects to. - `box` indicates the credentials are - * used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are - * used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to - * Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web - * crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud - * Object Store. - * - * @return the sourceType - */ - public String sourceType() { - return sourceType; - } - - /** - * Gets the credentialDetails. - * - *

Object containing details of the stored credentials. - * - *

Obtain credentials for your source from the administrator of the source. - * - * @return the credentialDetails - */ - public CredentialDetails credentialDetails() { - return credentialDetails; - } - - /** - * Gets the status. - * - *

Object that contains details about the status of the authentication process. - * - * @return the status - */ - public StatusDetails status() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteAllTrainingDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteAllTrainingDataOptions.java deleted file mode 100644 index f8256508c57..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteAllTrainingDataOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteAllTrainingData options. */ -public class DeleteAllTrainingDataOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing DeleteAllTrainingDataOptions instance. - * - * @param deleteAllTrainingDataOptions the instance to initialize the Builder with - */ - private Builder(DeleteAllTrainingDataOptions deleteAllTrainingDataOptions) { - this.environmentId = deleteAllTrainingDataOptions.environmentId; - this.collectionId = deleteAllTrainingDataOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a DeleteAllTrainingDataOptions. - * - * @return the new DeleteAllTrainingDataOptions instance - */ - public DeleteAllTrainingDataOptions build() { - return new DeleteAllTrainingDataOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteAllTrainingDataOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteAllTrainingDataOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected DeleteAllTrainingDataOptions() {} - - protected DeleteAllTrainingDataOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a DeleteAllTrainingDataOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCollectionOptions.java deleted file mode 100644 index d7d5b52e681..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCollectionOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteCollection options. */ -public class DeleteCollectionOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing DeleteCollectionOptions instance. - * - * @param deleteCollectionOptions the instance to initialize the Builder with - */ - private Builder(DeleteCollectionOptions deleteCollectionOptions) { - this.environmentId = deleteCollectionOptions.environmentId; - this.collectionId = deleteCollectionOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a DeleteCollectionOptions. - * - * @return the new DeleteCollectionOptions instance - */ - public DeleteCollectionOptions build() { - return new DeleteCollectionOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteCollectionOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteCollectionOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected DeleteCollectionOptions() {} - - protected DeleteCollectionOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a DeleteCollectionOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCollectionResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCollectionResponse.java deleted file mode 100644 index ead3c6d7f16..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCollectionResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Response object returned when deleting a colleciton. */ -public class DeleteCollectionResponse extends GenericModel { - - /** The status of the collection. The status of a successful deletion operation is `deleted`. */ - public interface Status { - /** deleted. */ - String DELETED = "deleted"; - } - - @SerializedName("collection_id") - protected String collectionId; - - protected String status; - - protected DeleteCollectionResponse() {} - - /** - * Gets the collectionId. - * - *

The unique identifier of the collection that is being deleted. - * - * @return the collectionId - */ - public String getCollectionId() { - return collectionId; - } - - /** - * Gets the status. - * - *

The status of the collection. The status of a successful deletion operation is `deleted`. - * - * @return the status - */ - public String getStatus() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationOptions.java deleted file mode 100644 index 1792e033f87..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteConfiguration options. */ -public class DeleteConfigurationOptions extends GenericModel { - - protected String environmentId; - protected String configurationId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String configurationId; - - /** - * Instantiates a new Builder from an existing DeleteConfigurationOptions instance. - * - * @param deleteConfigurationOptions the instance to initialize the Builder with - */ - private Builder(DeleteConfigurationOptions deleteConfigurationOptions) { - this.environmentId = deleteConfigurationOptions.environmentId; - this.configurationId = deleteConfigurationOptions.configurationId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param configurationId the configurationId - */ - public Builder(String environmentId, String configurationId) { - this.environmentId = environmentId; - this.configurationId = configurationId; - } - - /** - * Builds a DeleteConfigurationOptions. - * - * @return the new DeleteConfigurationOptions instance - */ - public DeleteConfigurationOptions build() { - return new DeleteConfigurationOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteConfigurationOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the configurationId. - * - * @param configurationId the configurationId - * @return the DeleteConfigurationOptions builder - */ - public Builder configurationId(String configurationId) { - this.configurationId = configurationId; - return this; - } - } - - protected DeleteConfigurationOptions() {} - - protected DeleteConfigurationOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.configurationId, "configurationId cannot be empty"); - environmentId = builder.environmentId; - configurationId = builder.configurationId; - } - - /** - * New builder. - * - * @return a DeleteConfigurationOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the configurationId. - * - *

The ID of the configuration. - * - * @return the configurationId - */ - public String configurationId() { - return configurationId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationResponse.java deleted file mode 100644 index f16984f80fb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationResponse.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Information returned when a configuration is deleted. */ -public class DeleteConfigurationResponse extends GenericModel { - - /** Status of the configuration. A deleted configuration has the status deleted. */ - public interface Status { - /** deleted. */ - String DELETED = "deleted"; - } - - @SerializedName("configuration_id") - protected String configurationId; - - protected String status; - protected List notices; - - protected DeleteConfigurationResponse() {} - - /** - * Gets the configurationId. - * - *

The unique identifier for the configuration. - * - * @return the configurationId - */ - public String getConfigurationId() { - return configurationId; - } - - /** - * Gets the status. - * - *

Status of the configuration. A deleted configuration has the status deleted. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the notices. - * - *

An array of notice messages, if any. - * - * @return the notices - */ - public List getNotices() { - return notices; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCredentials.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCredentials.java deleted file mode 100644 index 6e2ed33ff4c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCredentials.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object returned after credentials are deleted. */ -public class DeleteCredentials extends GenericModel { - - /** The status of the deletion request. */ - public interface Status { - /** deleted. */ - String DELETED = "deleted"; - } - - @SerializedName("credential_id") - protected String credentialId; - - protected String status; - - protected DeleteCredentials() {} - - /** - * Gets the credentialId. - * - *

The unique identifier of the credentials that have been deleted. - * - * @return the credentialId - */ - public String getCredentialId() { - return credentialId; - } - - /** - * Gets the status. - * - *

The status of the deletion request. - * - * @return the status - */ - public String getStatus() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsOptions.java deleted file mode 100644 index 81f261e93aa..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteCredentials options. */ -public class DeleteCredentialsOptions extends GenericModel { - - protected String environmentId; - protected String credentialId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String credentialId; - - /** - * Instantiates a new Builder from an existing DeleteCredentialsOptions instance. - * - * @param deleteCredentialsOptions the instance to initialize the Builder with - */ - private Builder(DeleteCredentialsOptions deleteCredentialsOptions) { - this.environmentId = deleteCredentialsOptions.environmentId; - this.credentialId = deleteCredentialsOptions.credentialId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param credentialId the credentialId - */ - public Builder(String environmentId, String credentialId) { - this.environmentId = environmentId; - this.credentialId = credentialId; - } - - /** - * Builds a DeleteCredentialsOptions. - * - * @return the new DeleteCredentialsOptions instance - */ - public DeleteCredentialsOptions build() { - return new DeleteCredentialsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteCredentialsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the credentialId. - * - * @param credentialId the credentialId - * @return the DeleteCredentialsOptions builder - */ - public Builder credentialId(String credentialId) { - this.credentialId = credentialId; - return this; - } - } - - protected DeleteCredentialsOptions() {} - - protected DeleteCredentialsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.credentialId, "credentialId cannot be empty"); - environmentId = builder.environmentId; - credentialId = builder.credentialId; - } - - /** - * New builder. - * - * @return a DeleteCredentialsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the credentialId. - * - *

The unique identifier for a set of source credentials. - * - * @return the credentialId - */ - public String credentialId() { - return credentialId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteDocumentOptions.java deleted file mode 100644 index 7b2487e1011..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteDocumentOptions.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteDocument options. */ -public class DeleteDocumentOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String documentId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - 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.environmentId = deleteDocumentOptions.environmentId; - this.collectionId = deleteDocumentOptions.collectionId; - this.documentId = deleteDocumentOptions.documentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param documentId the documentId - */ - public Builder(String environmentId, String collectionId, String documentId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.documentId = documentId; - } - - /** - * Builds a DeleteDocumentOptions. - * - * @return the new DeleteDocumentOptions instance - */ - public DeleteDocumentOptions build() { - return new DeleteDocumentOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteDocumentOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteDocumentOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the DeleteDocumentOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - } - - protected DeleteDocumentOptions() {} - - protected DeleteDocumentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.documentId, "documentId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - documentId = builder.documentId; - } - - /** - * New builder. - * - * @return a DeleteDocumentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the documentId. - * - *

The ID of the document. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteDocumentResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteDocumentResponse.java deleted file mode 100644 index d6607604164..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteDocumentResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Information returned when a document is deleted. */ -public class DeleteDocumentResponse extends GenericModel { - - /** Status of the document. A deleted document has the status deleted. */ - public interface Status { - /** deleted. */ - String DELETED = "deleted"; - } - - @SerializedName("document_id") - protected String documentId; - - protected String status; - - protected DeleteDocumentResponse() {} - - /** - * Gets the documentId. - * - *

The unique identifier of the document. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the status. - * - *

Status of the document. A deleted document has the status deleted. - * - * @return the status - */ - public String getStatus() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentOptions.java deleted file mode 100644 index d9e3544241c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteEnvironment options. */ -public class DeleteEnvironmentOptions extends GenericModel { - - protected String environmentId; - - /** Builder. */ - public static class Builder { - private String environmentId; - - /** - * Instantiates a new Builder from an existing DeleteEnvironmentOptions instance. - * - * @param deleteEnvironmentOptions the instance to initialize the Builder with - */ - private Builder(DeleteEnvironmentOptions deleteEnvironmentOptions) { - this.environmentId = deleteEnvironmentOptions.environmentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a DeleteEnvironmentOptions. - * - * @return the new DeleteEnvironmentOptions instance - */ - public DeleteEnvironmentOptions build() { - return new DeleteEnvironmentOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteEnvironmentOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - } - - protected DeleteEnvironmentOptions() {} - - protected DeleteEnvironmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - } - - /** - * New builder. - * - * @return a DeleteEnvironmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentResponse.java deleted file mode 100644 index b5afc6872fe..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentResponse.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Response object returned when deleting an environment. */ -public class DeleteEnvironmentResponse extends GenericModel { - - /** Status of the environment. */ - public interface Status { - /** deleted. */ - String DELETED = "deleted"; - } - - @SerializedName("environment_id") - protected String environmentId; - - protected String status; - - protected DeleteEnvironmentResponse() {} - - /** - * Gets the environmentId. - * - *

The unique identifier for the environment. - * - * @return the environmentId - */ - public String getEnvironmentId() { - return environmentId; - } - - /** - * Gets the status. - * - *

Status of the environment. - * - * @return the status - */ - public String getStatus() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteExpansionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteExpansionsOptions.java deleted file mode 100644 index 1cd06cbd364..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteExpansionsOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteExpansions options. */ -public class DeleteExpansionsOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing DeleteExpansionsOptions instance. - * - * @param deleteExpansionsOptions the instance to initialize the Builder with - */ - private Builder(DeleteExpansionsOptions deleteExpansionsOptions) { - this.environmentId = deleteExpansionsOptions.environmentId; - this.collectionId = deleteExpansionsOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a DeleteExpansionsOptions. - * - * @return the new DeleteExpansionsOptions instance - */ - public DeleteExpansionsOptions build() { - return new DeleteExpansionsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteExpansionsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteExpansionsOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected DeleteExpansionsOptions() {} - - protected DeleteExpansionsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a DeleteExpansionsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteGatewayOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteGatewayOptions.java deleted file mode 100644 index bbed8ee58bc..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteGatewayOptions.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteGateway options. */ -public class DeleteGatewayOptions extends GenericModel { - - protected String environmentId; - protected String gatewayId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String gatewayId; - - /** - * Instantiates a new Builder from an existing DeleteGatewayOptions instance. - * - * @param deleteGatewayOptions the instance to initialize the Builder with - */ - private Builder(DeleteGatewayOptions deleteGatewayOptions) { - this.environmentId = deleteGatewayOptions.environmentId; - this.gatewayId = deleteGatewayOptions.gatewayId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param gatewayId the gatewayId - */ - public Builder(String environmentId, String gatewayId) { - this.environmentId = environmentId; - this.gatewayId = gatewayId; - } - - /** - * Builds a DeleteGatewayOptions. - * - * @return the new DeleteGatewayOptions instance - */ - public DeleteGatewayOptions build() { - return new DeleteGatewayOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteGatewayOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the gatewayId. - * - * @param gatewayId the gatewayId - * @return the DeleteGatewayOptions builder - */ - public Builder gatewayId(String gatewayId) { - this.gatewayId = gatewayId; - return this; - } - } - - protected DeleteGatewayOptions() {} - - protected DeleteGatewayOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.gatewayId, "gatewayId cannot be empty"); - environmentId = builder.environmentId; - gatewayId = builder.gatewayId; - } - - /** - * New builder. - * - * @return a DeleteGatewayOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the gatewayId. - * - *

The requested gateway ID. - * - * @return the gatewayId - */ - public String gatewayId() { - return gatewayId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteStopwordListOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteStopwordListOptions.java deleted file mode 100644 index 02ef1228583..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteStopwordListOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteStopwordList options. */ -public class DeleteStopwordListOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing DeleteStopwordListOptions instance. - * - * @param deleteStopwordListOptions the instance to initialize the Builder with - */ - private Builder(DeleteStopwordListOptions deleteStopwordListOptions) { - this.environmentId = deleteStopwordListOptions.environmentId; - this.collectionId = deleteStopwordListOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a DeleteStopwordListOptions. - * - * @return the new DeleteStopwordListOptions instance - */ - public DeleteStopwordListOptions build() { - return new DeleteStopwordListOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteStopwordListOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteStopwordListOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected DeleteStopwordListOptions() {} - - protected DeleteStopwordListOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a DeleteStopwordListOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTokenizationDictionaryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTokenizationDictionaryOptions.java deleted file mode 100644 index b37ba0ffe64..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTokenizationDictionaryOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteTokenizationDictionary options. */ -public class DeleteTokenizationDictionaryOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing DeleteTokenizationDictionaryOptions instance. - * - * @param deleteTokenizationDictionaryOptions the instance to initialize the Builder with - */ - private Builder(DeleteTokenizationDictionaryOptions deleteTokenizationDictionaryOptions) { - this.environmentId = deleteTokenizationDictionaryOptions.environmentId; - this.collectionId = deleteTokenizationDictionaryOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a DeleteTokenizationDictionaryOptions. - * - * @return the new DeleteTokenizationDictionaryOptions instance - */ - public DeleteTokenizationDictionaryOptions build() { - return new DeleteTokenizationDictionaryOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteTokenizationDictionaryOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteTokenizationDictionaryOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected DeleteTokenizationDictionaryOptions() {} - - protected DeleteTokenizationDictionaryOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a DeleteTokenizationDictionaryOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTrainingDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTrainingDataOptions.java deleted file mode 100644 index 2f9e334ca56..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTrainingDataOptions.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteTrainingData options. */ -public class DeleteTrainingDataOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - - /** - * Instantiates a new Builder from an existing DeleteTrainingDataOptions instance. - * - * @param deleteTrainingDataOptions the instance to initialize the Builder with - */ - private Builder(DeleteTrainingDataOptions deleteTrainingDataOptions) { - this.environmentId = deleteTrainingDataOptions.environmentId; - this.collectionId = deleteTrainingDataOptions.collectionId; - this.queryId = deleteTrainingDataOptions.queryId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - */ - public Builder(String environmentId, String collectionId, String queryId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - } - - /** - * Builds a DeleteTrainingDataOptions. - * - * @return the new DeleteTrainingDataOptions instance - */ - public DeleteTrainingDataOptions build() { - return new DeleteTrainingDataOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteTrainingDataOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteTrainingDataOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the DeleteTrainingDataOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - } - - protected DeleteTrainingDataOptions() {} - - protected DeleteTrainingDataOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - } - - /** - * New builder. - * - * @return a DeleteTrainingDataOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTrainingExampleOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTrainingExampleOptions.java deleted file mode 100644 index a8d2497b333..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteTrainingExampleOptions.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteTrainingExample options. */ -public class DeleteTrainingExampleOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - protected String exampleId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - private String exampleId; - - /** - * Instantiates a new Builder from an existing DeleteTrainingExampleOptions instance. - * - * @param deleteTrainingExampleOptions the instance to initialize the Builder with - */ - private Builder(DeleteTrainingExampleOptions deleteTrainingExampleOptions) { - this.environmentId = deleteTrainingExampleOptions.environmentId; - this.collectionId = deleteTrainingExampleOptions.collectionId; - this.queryId = deleteTrainingExampleOptions.queryId; - this.exampleId = deleteTrainingExampleOptions.exampleId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - * @param exampleId the exampleId - */ - public Builder(String environmentId, String collectionId, String queryId, String exampleId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - this.exampleId = exampleId; - } - - /** - * Builds a DeleteTrainingExampleOptions. - * - * @return the new DeleteTrainingExampleOptions instance - */ - public DeleteTrainingExampleOptions build() { - return new DeleteTrainingExampleOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the DeleteTrainingExampleOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the DeleteTrainingExampleOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the DeleteTrainingExampleOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - - /** - * Set the exampleId. - * - * @param exampleId the exampleId - * @return the DeleteTrainingExampleOptions builder - */ - public Builder exampleId(String exampleId) { - this.exampleId = exampleId; - return this; - } - } - - protected DeleteTrainingExampleOptions() {} - - protected DeleteTrainingExampleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.exampleId, "exampleId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - exampleId = builder.exampleId; - } - - /** - * New builder. - * - * @return a DeleteTrainingExampleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } - - /** - * Gets the exampleId. - * - *

The ID of the document as it is indexed. - * - * @return the exampleId - */ - public String exampleId() { - return exampleId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptions.java deleted file mode 100644 index eea50014f4e..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptions.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteUserData options. */ -public class DeleteUserDataOptions extends GenericModel { - - protected String customerId; - - /** Builder. */ - public static class Builder { - private String customerId; - - /** - * Instantiates a new Builder from an existing DeleteUserDataOptions instance. - * - * @param deleteUserDataOptions the instance to initialize the Builder with - */ - private Builder(DeleteUserDataOptions deleteUserDataOptions) { - this.customerId = deleteUserDataOptions.customerId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param customerId the customerId - */ - public Builder(String customerId) { - this.customerId = customerId; - } - - /** - * Builds a DeleteUserDataOptions. - * - * @return the new DeleteUserDataOptions instance - */ - public DeleteUserDataOptions build() { - return new DeleteUserDataOptions(this); - } - - /** - * Set the customerId. - * - * @param customerId the customerId - * @return the DeleteUserDataOptions builder - */ - public Builder customerId(String customerId) { - this.customerId = customerId; - return this; - } - } - - protected DeleteUserDataOptions() {} - - protected DeleteUserDataOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.customerId, "customerId cannot be null"); - customerId = builder.customerId; - } - - /** - * New builder. - * - * @return a DeleteUserDataOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the customerId. - * - *

The customer ID for which all data is to be deleted. - * - * @return the customerId - */ - public String customerId() { - return customerId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DiskUsage.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DiskUsage.java deleted file mode 100644 index baf6f1e2383..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DiskUsage.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Summary of the disk usage statistics for the environment. */ -public class DiskUsage extends GenericModel { - - @SerializedName("used_bytes") - protected Long usedBytes; - - @SerializedName("maximum_allowed_bytes") - protected Long maximumAllowedBytes; - - protected DiskUsage() {} - - /** - * Gets the usedBytes. - * - *

Number of bytes within the environment's disk capacity that are currently used to store - * data. - * - * @return the usedBytes - */ - public Long getUsedBytes() { - return usedBytes; - } - - /** - * Gets the maximumAllowedBytes. - * - *

Total number of bytes available in the environment's disk capacity. - * - * @return the maximumAllowedBytes - */ - public Long getMaximumAllowedBytes() { - return maximumAllowedBytes; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentAccepted.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentAccepted.java deleted file mode 100644 index d5c19bc6f2e..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentAccepted.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Information returned after an uploaded document is accepted. */ -public class DocumentAccepted extends GenericModel { - - /** - * Status of the document in the ingestion process. A status of `processing` is returned for - * documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is - * returned for all others. - */ - public interface Status { - /** processing. */ - String PROCESSING = "processing"; - /** pending. */ - String PENDING = "pending"; - } - - @SerializedName("document_id") - protected String documentId; - - protected String status; - protected List notices; - - protected DocumentAccepted() {} - - /** - * Gets the documentId. - * - *

The unique identifier of the ingested document. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the status. - * - *

Status of the document in the ingestion process. A status of `processing` is returned for - * documents that are ingested with a *version* date before `2019-01-01`. The `pending` status is - * returned for all others. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the notices. - * - *

Array of notices produced by the document-ingestion process. - * - * @return the notices - */ - public List getNotices() { - return notices; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentCounts.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentCounts.java deleted file mode 100644 index cfff490ae7b..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentCounts.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing collection document count information. */ -public class DocumentCounts extends GenericModel { - - protected Long available; - protected Long processing; - protected Long failed; - protected Long pending; - - protected DocumentCounts() {} - - /** - * Gets the available. - * - *

The total number of available documents in the collection. - * - * @return the available - */ - public Long getAvailable() { - return available; - } - - /** - * Gets the processing. - * - *

The number of documents in the collection that are currently being processed. - * - * @return the processing - */ - public Long getProcessing() { - return processing; - } - - /** - * Gets the failed. - * - *

The number of documents in the collection that failed to be ingested. - * - * @return the failed - */ - public Long getFailed() { - return failed; - } - - /** - * Gets the pending. - * - *

The number of documents that have been uploaded to the collection, but have not yet started - * processing. - * - * @return the pending - */ - public Long getPending() { - return pending; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentStatus.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentStatus.java deleted file mode 100644 index dc925030519..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/DocumentStatus.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Status information about a submitted document. */ -public class DocumentStatus extends GenericModel { - - /** Status of the document in the ingestion process. */ - public interface Status { - /** available. */ - String AVAILABLE = "available"; - /** available with notices. */ - String AVAILABLE_WITH_NOTICES = "available with notices"; - /** failed. */ - String FAILED = "failed"; - /** processing. */ - String PROCESSING = "processing"; - /** pending. */ - String PENDING = "pending"; - } - - /** The type of the original source file. */ - public interface FileType { - /** pdf. */ - String PDF = "pdf"; - /** html. */ - String HTML = "html"; - /** word. */ - String WORD = "word"; - /** json. */ - String JSON = "json"; - } - - @SerializedName("document_id") - protected String documentId; - - @SerializedName("configuration_id") - protected String configurationId; - - protected String status; - - @SerializedName("status_description") - protected String statusDescription; - - protected String filename; - - @SerializedName("file_type") - protected String fileType; - - protected String sha1; - protected List notices; - - protected DocumentStatus() {} - - /** - * Gets the documentId. - * - *

The unique identifier of the document. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the configurationId. - * - *

The unique identifier for the configuration. - * - * @return the configurationId - */ - public String getConfigurationId() { - return configurationId; - } - - /** - * Gets the status. - * - *

Status of the document in the ingestion process. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the statusDescription. - * - *

Description of the document status. - * - * @return the statusDescription - */ - public String getStatusDescription() { - return statusDescription; - } - - /** - * Gets the filename. - * - *

Name of the original source file (if available). - * - * @return the filename - */ - public String getFilename() { - return filename; - } - - /** - * Gets the fileType. - * - *

The type of the original source file. - * - * @return the fileType - */ - public String getFileType() { - return fileType; - } - - /** - * Gets the sha1. - * - *

The SHA-1 hash of the original source file (formatted as a hexadecimal string). - * - * @return the sha1 - */ - public String getSha1() { - return sha1; - } - - /** - * Gets the notices. - * - *

Array of notices produced by the document-ingestion process. - * - * @return the notices - */ - public List getNotices() { - return notices; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Enrichment.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Enrichment.java deleted file mode 100644 index d117e8420a3..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Enrichment.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Enrichment step to perform on the document. Each enrichment is performed on the specified field - * in the order that they are listed in the configuration. - */ -public class Enrichment extends GenericModel { - - protected String description; - - @SerializedName("destination_field") - protected String destinationField; - - @SerializedName("source_field") - protected String sourceField; - - protected Boolean overwrite; - protected String enrichment; - - @SerializedName("ignore_downstream_errors") - protected Boolean ignoreDownstreamErrors; - - protected EnrichmentOptions options; - - /** Builder. */ - public static class Builder { - private String description; - private String destinationField; - private String sourceField; - private Boolean overwrite; - private String enrichment; - private Boolean ignoreDownstreamErrors; - private EnrichmentOptions options; - - /** - * Instantiates a new Builder from an existing Enrichment instance. - * - * @param enrichment the instance to initialize the Builder with - */ - private Builder(Enrichment enrichment) { - this.description = enrichment.description; - this.destinationField = enrichment.destinationField; - this.sourceField = enrichment.sourceField; - this.overwrite = enrichment.overwrite; - this.enrichment = enrichment.enrichment; - this.ignoreDownstreamErrors = enrichment.ignoreDownstreamErrors; - this.options = enrichment.options; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param destinationField the destinationField - * @param sourceField the sourceField - * @param enrichment the enrichment - */ - public Builder(String destinationField, String sourceField, String enrichment) { - this.destinationField = destinationField; - this.sourceField = sourceField; - this.enrichment = enrichment; - } - - /** - * Builds a Enrichment. - * - * @return the new Enrichment instance - */ - public Enrichment build() { - return new Enrichment(this); - } - - /** - * Set the description. - * - * @param description the description - * @return the Enrichment builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the destinationField. - * - * @param destinationField the destinationField - * @return the Enrichment builder - */ - public Builder destinationField(String destinationField) { - this.destinationField = destinationField; - return this; - } - - /** - * Set the sourceField. - * - * @param sourceField the sourceField - * @return the Enrichment builder - */ - public Builder sourceField(String sourceField) { - this.sourceField = sourceField; - return this; - } - - /** - * Set the overwrite. - * - * @param overwrite the overwrite - * @return the Enrichment builder - */ - public Builder overwrite(Boolean overwrite) { - this.overwrite = overwrite; - return this; - } - - /** - * Set the enrichment. - * - * @param enrichment the enrichment - * @return the Enrichment builder - */ - public Builder enrichment(String enrichment) { - this.enrichment = enrichment; - return this; - } - - /** - * Set the ignoreDownstreamErrors. - * - * @param ignoreDownstreamErrors the ignoreDownstreamErrors - * @return the Enrichment builder - */ - public Builder ignoreDownstreamErrors(Boolean ignoreDownstreamErrors) { - this.ignoreDownstreamErrors = ignoreDownstreamErrors; - return this; - } - - /** - * Set the options. - * - * @param options the options - * @return the Enrichment builder - */ - public Builder options(EnrichmentOptions options) { - this.options = options; - return this; - } - } - - protected Enrichment() {} - - protected Enrichment(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.destinationField, "destinationField cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.sourceField, "sourceField cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.enrichment, "enrichment cannot be null"); - description = builder.description; - destinationField = builder.destinationField; - sourceField = builder.sourceField; - overwrite = builder.overwrite; - enrichment = builder.enrichment; - ignoreDownstreamErrors = builder.ignoreDownstreamErrors; - options = builder.options; - } - - /** - * New builder. - * - * @return a Enrichment builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the description. - * - *

Describes what the enrichment step does. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the destinationField. - * - *

Field where enrichments will be stored. This field must already exist or be at most 1 level - * deeper than an existing field. For example, if `text` is a top-level field with no sub-fields, - * `text.foo` is a valid destination but `text.foo.bar` is not. - * - * @return the destinationField - */ - public String destinationField() { - return destinationField; - } - - /** - * Gets the sourceField. - * - *

Field to be enriched. - * - *

Arrays can be specified as the **source_field** if the **enrichment** service for this - * enrichment is set to `natural_language_undstanding`. - * - * @return the sourceField - */ - public String sourceField() { - return sourceField; - } - - /** - * Gets the overwrite. - * - *

Indicates that the enrichments will overwrite the destination_field field if it already - * exists. - * - * @return the overwrite - */ - public Boolean overwrite() { - return overwrite; - } - - /** - * Gets the enrichment. - * - *

Name of the enrichment service to call. The only supported option is - * `natural_language_understanding`. The `elements` option is deprecated and support ended on 10 - * July 2020. - * - *

The **options** object must contain Natural Language Understanding options. - * - * @return the enrichment - */ - public String enrichment() { - return enrichment; - } - - /** - * Gets the ignoreDownstreamErrors. - * - *

If true, then most errors generated during the enrichment process will be treated as - * warnings and will not cause the document to fail processing. - * - * @return the ignoreDownstreamErrors - */ - public Boolean ignoreDownstreamErrors() { - return ignoreDownstreamErrors; - } - - /** - * Gets the options. - * - *

Options that are specific to a particular enrichment. - * - *

The `elements` enrichment type is deprecated. Use the [Create a - * project](https://cloud.ibm.com/apidocs/discovery-data#createproject) method of the Discovery v2 - * API to create a `content_intelligence` project type instead. - * - * @return the options - */ - public EnrichmentOptions options() { - return options; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EnrichmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EnrichmentOptions.java deleted file mode 100644 index 3ededcc730b..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EnrichmentOptions.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Options that are specific to a particular enrichment. - * - *

The `elements` enrichment type is deprecated. Use the [Create a - * project](https://cloud.ibm.com/apidocs/discovery-data#createproject) method of the Discovery v2 - * API to create a `content_intelligence` project type instead. - */ -public class EnrichmentOptions extends GenericModel { - - /** - * ISO 639-1 code indicating the language to use for the analysis. This code overrides the - * automatic language detection performed by the service. Valid codes are `ar` (Arabic), `en` - * (English), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), - * `es` (Spanish), and `sv` (Swedish). **Note:** Not all features support all languages, automatic - * detection is recommended. - */ - public interface Language { - /** ar. */ - String AR = "ar"; - /** en. */ - String EN = "en"; - /** fr. */ - String FR = "fr"; - /** de. */ - String DE = "de"; - /** it. */ - String IT = "it"; - /** pt. */ - String PT = "pt"; - /** ru. */ - String RU = "ru"; - /** es. */ - String ES = "es"; - /** sv. */ - String SV = "sv"; - } - - protected NluEnrichmentFeatures features; - protected String language; - protected String model; - - /** Builder. */ - public static class Builder { - private NluEnrichmentFeatures features; - private String language; - private String model; - - /** - * Instantiates a new Builder from an existing EnrichmentOptions instance. - * - * @param enrichmentOptions the instance to initialize the Builder with - */ - private Builder(EnrichmentOptions enrichmentOptions) { - this.features = enrichmentOptions.features; - this.language = enrichmentOptions.language; - this.model = enrichmentOptions.model; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a EnrichmentOptions. - * - * @return the new EnrichmentOptions instance - */ - public EnrichmentOptions build() { - return new EnrichmentOptions(this); - } - - /** - * Set the features. - * - * @param features the features - * @return the EnrichmentOptions builder - */ - public Builder features(NluEnrichmentFeatures features) { - this.features = features; - return this; - } - - /** - * Set the language. - * - * @param language the language - * @return the EnrichmentOptions builder - */ - public Builder language(String language) { - this.language = language; - return this; - } - - /** - * Set the model. - * - * @param model the model - * @return the EnrichmentOptions builder - * @deprecated this method is deprecated and may be removed in a future release - */ - @Deprecated - public Builder model(String model) { - this.model = model; - return this; - } - } - - protected EnrichmentOptions() {} - - protected EnrichmentOptions(Builder builder) { - features = builder.features; - language = builder.language; - model = builder.model; - } - - /** - * New builder. - * - * @return a EnrichmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the features. - * - *

Object containing Natural Language Understanding features to be used. - * - * @return the features - */ - public NluEnrichmentFeatures features() { - return features; - } - - /** - * Gets the language. - * - *

ISO 639-1 code indicating the language to use for the analysis. This code overrides the - * automatic language detection performed by the service. Valid codes are `ar` (Arabic), `en` - * (English), `fr` (French), `de` (German), `it` (Italian), `pt` (Portuguese), `ru` (Russian), - * `es` (Spanish), and `sv` (Swedish). **Note:** Not all features support all languages, automatic - * detection is recommended. - * - * @return the language - */ - public String language() { - return language; - } - - /** - * Gets the model. - * - *

The element extraction model to use, which can be `contract` only. The `elements` enrichment - * is deprecated. - * - * @return the model - * @deprecated this method is deprecated and may be removed in a future release - */ - @Deprecated - public String model() { - return model; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Environment.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Environment.java deleted file mode 100644 index 625c8a0527b..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Environment.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** Details about an environment. */ -public class Environment extends GenericModel { - - /** - * Current status of the environment. `resizing` is displayed when a request to increase the - * environment size has been made, but is still in the process of being completed. - */ - public interface Status { - /** active. */ - String ACTIVE = "active"; - /** pending. */ - String PENDING = "pending"; - /** maintenance. */ - String MAINTENANCE = "maintenance"; - /** resizing. */ - String RESIZING = "resizing"; - } - - /** Current size of the environment. */ - public interface Size { - /** LT. */ - String LT = "LT"; - /** XS. */ - String XS = "XS"; - /** S. */ - String S = "S"; - /** MS. */ - String MS = "MS"; - /** M. */ - String M = "M"; - /** ML. */ - String ML = "ML"; - /** L. */ - String L = "L"; - /** XL. */ - String XL = "XL"; - /** XXL. */ - String XXL = "XXL"; - /** XXXL. */ - String XXXL = "XXXL"; - } - - @SerializedName("environment_id") - protected String environmentId; - - protected String name; - protected String description; - protected Date created; - protected Date updated; - protected String status; - - @SerializedName("read_only") - protected Boolean readOnly; - - protected String size; - - @SerializedName("requested_size") - protected String requestedSize; - - @SerializedName("index_capacity") - protected IndexCapacity indexCapacity; - - @SerializedName("search_status") - protected SearchStatus searchStatus; - - protected Environment() {} - - /** - * Gets the environmentId. - * - *

Unique identifier for the environment. - * - * @return the environmentId - */ - public String getEnvironmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

Name that identifies the environment. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the description. - * - *

Description of the environment. - * - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * Gets the created. - * - *

Creation date of the environment, in the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. - * - * @return the created - */ - public Date getCreated() { - return created; - } - - /** - * Gets the updated. - * - *

Date of most recent environment update, in the format `yyyy-MM-dd'T'HH:mm:ss.SSS'Z'`. - * - * @return the updated - */ - public Date getUpdated() { - return updated; - } - - /** - * Gets the status. - * - *

Current status of the environment. `resizing` is displayed when a request to increase the - * environment size has been made, but is still in the process of being completed. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the readOnly. - * - *

If `true`, the environment contains read-only collections that are maintained by IBM. - * - * @return the readOnly - */ - public Boolean isReadOnly() { - return readOnly; - } - - /** - * Gets the size. - * - *

Current size of the environment. - * - * @return the size - */ - public String getSize() { - return size; - } - - /** - * Gets the requestedSize. - * - *

The new size requested for this environment. Only returned when the environment *status* is - * `resizing`. - * - *

*Note:* Querying and indexing can still be performed during an environment upsize. - * - * @return the requestedSize - */ - public String getRequestedSize() { - return requestedSize; - } - - /** - * Gets the indexCapacity. - * - *

Details about the resource usage and capacity of the environment. - * - * @return the indexCapacity - */ - public IndexCapacity getIndexCapacity() { - return indexCapacity; - } - - /** - * Gets the searchStatus. - * - *

Information about the Continuous Relevancy Training for this environment. - * - * @return the searchStatus - */ - public SearchStatus getSearchStatus() { - return searchStatus; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EnvironmentDocuments.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EnvironmentDocuments.java deleted file mode 100644 index 21f8629e4bf..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EnvironmentDocuments.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Summary of the document usage statistics for the environment. */ -public class EnvironmentDocuments extends GenericModel { - - protected Long available; - - @SerializedName("maximum_allowed") - protected Long maximumAllowed; - - protected EnvironmentDocuments() {} - - /** - * Gets the available. - * - *

Number of documents indexed for the environment. - * - * @return the available - */ - public Long getAvailable() { - return available; - } - - /** - * Gets the maximumAllowed. - * - *

Total number of documents allowed in the environment's capacity. - * - * @return the maximumAllowed - */ - public Long getMaximumAllowed() { - return maximumAllowed; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EventData.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EventData.java deleted file mode 100644 index 84012c15bbe..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/EventData.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** Query event data object. */ -public class EventData extends GenericModel { - - @SerializedName("environment_id") - protected String environmentId; - - @SerializedName("session_token") - protected String sessionToken; - - @SerializedName("client_timestamp") - protected Date clientTimestamp; - - @SerializedName("display_rank") - protected Long displayRank; - - @SerializedName("collection_id") - protected String collectionId; - - @SerializedName("document_id") - protected String documentId; - - @SerializedName("query_id") - protected String queryId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String sessionToken; - private Date clientTimestamp; - private Long displayRank; - private String collectionId; - private String documentId; - - /** - * Instantiates a new Builder from an existing EventData instance. - * - * @param eventData the instance to initialize the Builder with - */ - private Builder(EventData eventData) { - this.environmentId = eventData.environmentId; - this.sessionToken = eventData.sessionToken; - this.clientTimestamp = eventData.clientTimestamp; - this.displayRank = eventData.displayRank; - this.collectionId = eventData.collectionId; - this.documentId = eventData.documentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param sessionToken the sessionToken - * @param collectionId the collectionId - * @param documentId the documentId - */ - public Builder( - String environmentId, String sessionToken, String collectionId, String documentId) { - this.environmentId = environmentId; - this.sessionToken = sessionToken; - this.collectionId = collectionId; - this.documentId = documentId; - } - - /** - * Builds a EventData. - * - * @return the new EventData instance - */ - public EventData build() { - return new EventData(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the EventData builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the sessionToken. - * - * @param sessionToken the sessionToken - * @return the EventData builder - */ - public Builder sessionToken(String sessionToken) { - this.sessionToken = sessionToken; - return this; - } - - /** - * Set the clientTimestamp. - * - * @param clientTimestamp the clientTimestamp - * @return the EventData builder - */ - public Builder clientTimestamp(Date clientTimestamp) { - this.clientTimestamp = clientTimestamp; - return this; - } - - /** - * Set the displayRank. - * - * @param displayRank the displayRank - * @return the EventData builder - */ - public Builder displayRank(long displayRank) { - this.displayRank = displayRank; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the EventData builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the EventData builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - } - - protected EventData() {} - - protected EventData(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.environmentId, "environmentId cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.sessionToken, "sessionToken cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.collectionId, "collectionId cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.documentId, "documentId cannot be null"); - environmentId = builder.environmentId; - sessionToken = builder.sessionToken; - clientTimestamp = builder.clientTimestamp; - displayRank = builder.displayRank; - collectionId = builder.collectionId; - documentId = builder.documentId; - } - - /** - * New builder. - * - * @return a EventData builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The **environment_id** associated with the query that the event is associated with. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the sessionToken. - * - *

The session token that was returned as part of the query results that this event is - * associated with. - * - * @return the sessionToken - */ - public String sessionToken() { - return sessionToken; - } - - /** - * Gets the clientTimestamp. - * - *

The optional timestamp for the event that was created. If not provided, the time that the - * event was created in the log was used. - * - * @return the clientTimestamp - */ - public Date clientTimestamp() { - return clientTimestamp; - } - - /** - * Gets the displayRank. - * - *

The rank of the result item which the event is associated with. - * - * @return the displayRank - */ - public Long displayRank() { - return displayRank; - } - - /** - * Gets the collectionId. - * - *

The **collection_id** of the document that this event is associated with. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the documentId. - * - *

The **document_id** of the document that this event is associated with. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } - - /** - * Gets the queryId. - * - *

The query identifier stored in the log. The query and any events associated with that query - * are stored with the same **query_id**. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Expansion.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Expansion.java deleted file mode 100644 index 0bdaf75e62d..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Expansion.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** - * An expansion definition. Each object respresents one set of expandable strings. For example, you - * could have expansions for the word `hot` in one object, and expansions for the word `cold` in - * another. - */ -public class Expansion extends GenericModel { - - @SerializedName("input_terms") - protected List inputTerms; - - @SerializedName("expanded_terms") - protected List expandedTerms; - - /** Builder. */ - public static class Builder { - private List inputTerms; - private List expandedTerms; - - /** - * Instantiates a new Builder from an existing Expansion instance. - * - * @param expansion the instance to initialize the Builder with - */ - private Builder(Expansion expansion) { - this.inputTerms = expansion.inputTerms; - this.expandedTerms = expansion.expandedTerms; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param expandedTerms the expandedTerms - */ - public Builder(List expandedTerms) { - this.expandedTerms = expandedTerms; - } - - /** - * Builds a Expansion. - * - * @return the new Expansion instance - */ - public Expansion build() { - return new Expansion(this); - } - - /** - * Adds a new element to inputTerms. - * - * @param inputTerms the new element to be added - * @return the Expansion builder - */ - public Builder addInputTerms(String inputTerms) { - com.ibm.cloud.sdk.core.util.Validator.notNull(inputTerms, "inputTerms cannot be null"); - if (this.inputTerms == null) { - this.inputTerms = new ArrayList(); - } - this.inputTerms.add(inputTerms); - return this; - } - - /** - * Adds a new element to expandedTerms. - * - * @param expandedTerms the new element to be added - * @return the Expansion builder - */ - public Builder addExpandedTerms(String expandedTerms) { - com.ibm.cloud.sdk.core.util.Validator.notNull(expandedTerms, "expandedTerms cannot be null"); - if (this.expandedTerms == null) { - this.expandedTerms = new ArrayList(); - } - this.expandedTerms.add(expandedTerms); - return this; - } - - /** - * Set the inputTerms. Existing inputTerms will be replaced. - * - * @param inputTerms the inputTerms - * @return the Expansion builder - */ - public Builder inputTerms(List inputTerms) { - this.inputTerms = inputTerms; - return this; - } - - /** - * Set the expandedTerms. Existing expandedTerms will be replaced. - * - * @param expandedTerms the expandedTerms - * @return the Expansion builder - */ - public Builder expandedTerms(List expandedTerms) { - this.expandedTerms = expandedTerms; - return this; - } - } - - protected Expansion() {} - - protected Expansion(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.expandedTerms, "expandedTerms cannot be null"); - inputTerms = builder.inputTerms; - expandedTerms = builder.expandedTerms; - } - - /** - * New builder. - * - * @return a Expansion builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the inputTerms. - * - *

A list of terms that will be expanded for this expansion. If specified, only the items in - * this list are expanded. - * - * @return the inputTerms - */ - public List inputTerms() { - return inputTerms; - } - - /** - * Gets the expandedTerms. - * - *

A list of terms that this expansion will be expanded to. If specified without - * **input_terms**, it also functions as the input term list. - * - * @return the expandedTerms - */ - public List expandedTerms() { - return expandedTerms; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Expansions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Expansions.java deleted file mode 100644 index c31cdf32d63..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Expansions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The query expansion definitions for the specified collection. */ -public class Expansions extends GenericModel { - - protected List expansions; - - /** Builder. */ - public static class Builder { - private List expansions; - - /** - * Instantiates a new Builder from an existing Expansions instance. - * - * @param expansions the instance to initialize the Builder with - */ - private Builder(Expansions expansions) { - this.expansions = expansions.expansions; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param expansions the expansions - */ - public Builder(List expansions) { - this.expansions = expansions; - } - - /** - * Builds a Expansions. - * - * @return the new Expansions instance - */ - public Expansions build() { - return new Expansions(this); - } - - /** - * Adds a new element to expansions. - * - * @param expansions the new element to be added - * @return the Expansions builder - */ - public Builder addExpansions(Expansion expansions) { - com.ibm.cloud.sdk.core.util.Validator.notNull(expansions, "expansions cannot be null"); - if (this.expansions == null) { - this.expansions = new ArrayList(); - } - this.expansions.add(expansions); - return this; - } - - /** - * Set the expansions. Existing expansions will be replaced. - * - * @param expansions the expansions - * @return the Expansions builder - */ - public Builder expansions(List expansions) { - this.expansions = expansions; - return this; - } - } - - protected Expansions() {} - - protected Expansions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.expansions, "expansions cannot be null"); - expansions = builder.expansions; - } - - /** - * New builder. - * - * @return a Expansions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the expansions. - * - *

An array of query expansion definitions. - * - *

Each object in the **expansions** array represents a term or set of terms that will be - * expanded into other terms. Each expansion object can be configured as bidirectional or - * unidirectional. Bidirectional means that all terms are expanded to all other terms in the - * object. Unidirectional means that a set list of terms can be expanded into a second list of - * terms. - * - *

To create a bi-directional expansion specify an **expanded_terms** array. When found in a - * query, all items in the **expanded_terms** array are then expanded to the other items in the - * same array. - * - *

To create a uni-directional expansion, specify both an array of **input_terms** and an array - * of **expanded_terms**. When items in the **input_terms** array are present in a query, they are - * expanded using the items listed in the **expanded_terms** array. - * - * @return the expansions - */ - public List expansions() { - return expansions; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FederatedQueryNoticesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FederatedQueryNoticesOptions.java deleted file mode 100644 index 3314da775a1..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FederatedQueryNoticesOptions.java +++ /dev/null @@ -1,560 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The federatedQueryNotices options. */ -public class FederatedQueryNoticesOptions extends GenericModel { - - protected String environmentId; - protected List collectionIds; - protected String filter; - protected String query; - protected String naturalLanguageQuery; - protected String aggregation; - protected Long count; - protected List xReturn; - protected Long offset; - protected List sort; - protected Boolean highlight; - protected String deduplicateField; - protected Boolean similar; - protected List similarDocumentIds; - protected List similarFields; - - /** Builder. */ - public static class Builder { - private String environmentId; - private List collectionIds; - private String filter; - private String query; - private String naturalLanguageQuery; - private String aggregation; - private Long count; - private List xReturn; - private Long offset; - private List sort; - private Boolean highlight; - private String deduplicateField; - private Boolean similar; - private List similarDocumentIds; - private List similarFields; - - /** - * Instantiates a new Builder from an existing FederatedQueryNoticesOptions instance. - * - * @param federatedQueryNoticesOptions the instance to initialize the Builder with - */ - private Builder(FederatedQueryNoticesOptions federatedQueryNoticesOptions) { - this.environmentId = federatedQueryNoticesOptions.environmentId; - this.collectionIds = federatedQueryNoticesOptions.collectionIds; - this.filter = federatedQueryNoticesOptions.filter; - this.query = federatedQueryNoticesOptions.query; - this.naturalLanguageQuery = federatedQueryNoticesOptions.naturalLanguageQuery; - this.aggregation = federatedQueryNoticesOptions.aggregation; - this.count = federatedQueryNoticesOptions.count; - this.xReturn = federatedQueryNoticesOptions.xReturn; - this.offset = federatedQueryNoticesOptions.offset; - this.sort = federatedQueryNoticesOptions.sort; - this.highlight = federatedQueryNoticesOptions.highlight; - this.deduplicateField = federatedQueryNoticesOptions.deduplicateField; - this.similar = federatedQueryNoticesOptions.similar; - this.similarDocumentIds = federatedQueryNoticesOptions.similarDocumentIds; - this.similarFields = federatedQueryNoticesOptions.similarFields; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionIds the collectionIds - */ - public Builder(String environmentId, List collectionIds) { - this.environmentId = environmentId; - this.collectionIds = collectionIds; - } - - /** - * Builds a FederatedQueryNoticesOptions. - * - * @return the new FederatedQueryNoticesOptions instance - */ - public FederatedQueryNoticesOptions build() { - return new FederatedQueryNoticesOptions(this); - } - - /** - * Adds a new element to collectionIds. - * - * @param collectionIds the new element to be added - * @return the FederatedQueryNoticesOptions builder - */ - public Builder addCollectionIds(String collectionIds) { - com.ibm.cloud.sdk.core.util.Validator.notNull(collectionIds, "collectionIds cannot be null"); - if (this.collectionIds == null) { - this.collectionIds = new ArrayList(); - } - this.collectionIds.add(collectionIds); - return this; - } - - /** - * Adds a new element to xReturn. - * - * @param returnField the new element to be added - * @return the FederatedQueryNoticesOptions builder - */ - public Builder addReturnField(String returnField) { - com.ibm.cloud.sdk.core.util.Validator.notNull(returnField, "returnField cannot be null"); - if (this.xReturn == null) { - this.xReturn = new ArrayList(); - } - this.xReturn.add(returnField); - return this; - } - - /** - * Adds a new element to sort. - * - * @param sort the new element to be added - * @return the FederatedQueryNoticesOptions builder - */ - public Builder addSort(String sort) { - com.ibm.cloud.sdk.core.util.Validator.notNull(sort, "sort cannot be null"); - if (this.sort == null) { - this.sort = new ArrayList(); - } - this.sort.add(sort); - return this; - } - - /** - * Adds a new element to similarDocumentIds. - * - * @param similarDocumentIds the new element to be added - * @return the FederatedQueryNoticesOptions builder - */ - public Builder addSimilarDocumentIds(String similarDocumentIds) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - similarDocumentIds, "similarDocumentIds cannot be null"); - if (this.similarDocumentIds == null) { - this.similarDocumentIds = new ArrayList(); - } - this.similarDocumentIds.add(similarDocumentIds); - return this; - } - - /** - * Adds a new element to similarFields. - * - * @param similarFields the new element to be added - * @return the FederatedQueryNoticesOptions builder - */ - public Builder addSimilarFields(String similarFields) { - com.ibm.cloud.sdk.core.util.Validator.notNull(similarFields, "similarFields cannot be null"); - if (this.similarFields == null) { - this.similarFields = new ArrayList(); - } - this.similarFields.add(similarFields); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the FederatedQueryNoticesOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionIds. Existing collectionIds will be replaced. - * - * @param collectionIds the collectionIds - * @return the FederatedQueryNoticesOptions builder - */ - public Builder collectionIds(List collectionIds) { - this.collectionIds = collectionIds; - return this; - } - - /** - * Set the filter. - * - * @param filter the filter - * @return the FederatedQueryNoticesOptions builder - */ - public Builder filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set the query. - * - * @param query the query - * @return the FederatedQueryNoticesOptions builder - */ - public Builder query(String query) { - this.query = query; - return this; - } - - /** - * Set the naturalLanguageQuery. - * - * @param naturalLanguageQuery the naturalLanguageQuery - * @return the FederatedQueryNoticesOptions builder - */ - public Builder naturalLanguageQuery(String naturalLanguageQuery) { - this.naturalLanguageQuery = naturalLanguageQuery; - return this; - } - - /** - * Set the aggregation. - * - * @param aggregation the aggregation - * @return the FederatedQueryNoticesOptions builder - */ - public Builder aggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Set the count. - * - * @param count the count - * @return the FederatedQueryNoticesOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - - /** - * Set the xReturn. Existing xReturn will be replaced. - * - * @param xReturn the xReturn - * @return the FederatedQueryNoticesOptions builder - */ - public Builder xReturn(List xReturn) { - this.xReturn = xReturn; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the FederatedQueryNoticesOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - - /** - * Set the sort. Existing sort will be replaced. - * - * @param sort the sort - * @return the FederatedQueryNoticesOptions builder - */ - public Builder sort(List sort) { - this.sort = sort; - return this; - } - - /** - * Set the highlight. - * - * @param highlight the highlight - * @return the FederatedQueryNoticesOptions builder - */ - public Builder highlight(Boolean highlight) { - this.highlight = highlight; - return this; - } - - /** - * Set the deduplicateField. - * - * @param deduplicateField the deduplicateField - * @return the FederatedQueryNoticesOptions builder - */ - public Builder deduplicateField(String deduplicateField) { - this.deduplicateField = deduplicateField; - return this; - } - - /** - * Set the similar. - * - * @param similar the similar - * @return the FederatedQueryNoticesOptions builder - */ - public Builder similar(Boolean similar) { - this.similar = similar; - return this; - } - - /** - * Set the similarDocumentIds. Existing similarDocumentIds will be replaced. - * - * @param similarDocumentIds the similarDocumentIds - * @return the FederatedQueryNoticesOptions builder - */ - public Builder similarDocumentIds(List similarDocumentIds) { - this.similarDocumentIds = similarDocumentIds; - return this; - } - - /** - * Set the similarFields. Existing similarFields will be replaced. - * - * @param similarFields the similarFields - * @return the FederatedQueryNoticesOptions builder - */ - public Builder similarFields(List similarFields) { - this.similarFields = similarFields; - return this; - } - } - - protected FederatedQueryNoticesOptions() {} - - protected FederatedQueryNoticesOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.collectionIds, "collectionIds cannot be null"); - environmentId = builder.environmentId; - collectionIds = builder.collectionIds; - filter = builder.filter; - query = builder.query; - naturalLanguageQuery = builder.naturalLanguageQuery; - aggregation = builder.aggregation; - count = builder.count; - xReturn = builder.xReturn; - offset = builder.offset; - sort = builder.sort; - highlight = builder.highlight; - deduplicateField = builder.deduplicateField; - similar = builder.similar; - similarDocumentIds = builder.similarDocumentIds; - similarFields = builder.similarFields; - } - - /** - * New builder. - * - * @return a FederatedQueryNoticesOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionIds. - * - *

A comma-separated list of collection IDs to be queried against. - * - * @return the collectionIds - */ - public List collectionIds() { - return collectionIds; - } - - /** - * Gets the filter. - * - *

A cacheable query that excludes documents that don't mention the query content. Filter - * searches are better for metadata-type searches and for assessing the concepts in the data set. - * - * @return the filter - */ - public String filter() { - return filter; - } - - /** - * Gets the query. - * - *

A query search returns all documents in your data set with full enrichments and full text, - * but with the most relevant documents listed first. - * - * @return the query - */ - public String query() { - return query; - } - - /** - * Gets the naturalLanguageQuery. - * - *

A natural language query that returns relevant documents by utilizing training data and - * natural language understanding. - * - * @return the naturalLanguageQuery - */ - public String naturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the aggregation. - * - *

An aggregation search that returns an exact answer by combining query search with filters. - * Useful for applications to build lists, tables, and time series. For a full list of possible - * aggregations, see the Query reference. - * - * @return the aggregation - */ - public String aggregation() { - return aggregation; - } - - /** - * Gets the count. - * - *

Number of results to return. The maximum for the **count** and **offset** values together in - * any one query is **10000**. - * - * @return the count - */ - public Long count() { - return count; - } - - /** - * Gets the xReturn. - * - *

A comma-separated list of the portion of the document hierarchy to return. - * - * @return the xReturn - */ - public List xReturn() { - return xReturn; - } - - /** - * Gets the offset. - * - *

The number of query results to skip at the beginning. For example, if the total number of - * results that are returned is 10 and the offset is 8, it returns the last two results. The - * maximum for the **count** and **offset** values together in any one query is **10000**. - * - * @return the offset - */ - public Long offset() { - return offset; - } - - /** - * Gets the sort. - * - *

A comma-separated list of fields in the document to sort on. You can optionally specify a - * sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending - * is the default sort direction if no prefix is specified. - * - * @return the sort - */ - public List sort() { - return sort; - } - - /** - * Gets the highlight. - * - *

When true, a highlight field is returned for each result which contains the fields which - * match the query with `<em></em>` tags around the matching query terms. - * - * @return the highlight - */ - public Boolean highlight() { - return highlight; - } - - /** - * Gets the deduplicateField. - * - *

When specified, duplicate results based on the field specified are removed from the returned - * results. Duplicate comparison is limited to the current query only, **offset** is not - * considered. This parameter is currently Beta functionality. - * - * @return the deduplicateField - */ - public String deduplicateField() { - return deduplicateField; - } - - /** - * Gets the similar. - * - *

When `true`, results are returned based on their similarity to the document IDs specified in - * the **similar.document_ids** parameter. - * - * @return the similar - */ - public Boolean similar() { - return similar; - } - - /** - * Gets the similarDocumentIds. - * - *

A comma-separated list of document IDs to find similar documents. - * - *

**Tip:** Include the **natural_language_query** parameter to expand the scope of the - * document similarity search with the natural language query. Other query parameters, such as - * **filter** and **query**, are subsequently applied and reduce the scope. - * - * @return the similarDocumentIds - */ - public List similarDocumentIds() { - return similarDocumentIds; - } - - /** - * Gets the similarFields. - * - *

A comma-separated list of field names that are used as a basis for comparison to identify - * similar documents. If not specified, the entire document is used for comparison. - * - * @return the similarFields - */ - public List similarFields() { - return similarFields; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FederatedQueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FederatedQueryOptions.java deleted file mode 100644 index b539321a90f..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FederatedQueryOptions.java +++ /dev/null @@ -1,673 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The federatedQuery options. */ -public class FederatedQueryOptions extends GenericModel { - - protected String environmentId; - protected String collectionIds; - protected String filter; - protected String query; - protected String naturalLanguageQuery; - protected Boolean passages; - protected String aggregation; - protected Long count; - protected String xReturn; - protected Long offset; - protected String sort; - protected Boolean highlight; - protected String passagesFields; - protected Long passagesCount; - protected Long passagesCharacters; - protected Boolean deduplicate; - protected String deduplicateField; - protected Boolean similar; - protected String similarDocumentIds; - protected String similarFields; - protected String bias; - protected Boolean xWatsonLoggingOptOut; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionIds; - private String filter; - private String query; - private String naturalLanguageQuery; - private Boolean passages; - private String aggregation; - private Long count; - private String xReturn; - private Long offset; - private String sort; - private Boolean highlight; - private String passagesFields; - private Long passagesCount; - private Long passagesCharacters; - private Boolean deduplicate; - private String deduplicateField; - private Boolean similar; - private String similarDocumentIds; - private String similarFields; - private String bias; - private Boolean xWatsonLoggingOptOut; - - /** - * Instantiates a new Builder from an existing FederatedQueryOptions instance. - * - * @param federatedQueryOptions the instance to initialize the Builder with - */ - private Builder(FederatedQueryOptions federatedQueryOptions) { - this.environmentId = federatedQueryOptions.environmentId; - this.collectionIds = federatedQueryOptions.collectionIds; - this.filter = federatedQueryOptions.filter; - this.query = federatedQueryOptions.query; - this.naturalLanguageQuery = federatedQueryOptions.naturalLanguageQuery; - this.passages = federatedQueryOptions.passages; - this.aggregation = federatedQueryOptions.aggregation; - this.count = federatedQueryOptions.count; - this.xReturn = federatedQueryOptions.xReturn; - this.offset = federatedQueryOptions.offset; - this.sort = federatedQueryOptions.sort; - this.highlight = federatedQueryOptions.highlight; - this.passagesFields = federatedQueryOptions.passagesFields; - this.passagesCount = federatedQueryOptions.passagesCount; - this.passagesCharacters = federatedQueryOptions.passagesCharacters; - this.deduplicate = federatedQueryOptions.deduplicate; - this.deduplicateField = federatedQueryOptions.deduplicateField; - this.similar = federatedQueryOptions.similar; - this.similarDocumentIds = federatedQueryOptions.similarDocumentIds; - this.similarFields = federatedQueryOptions.similarFields; - this.bias = federatedQueryOptions.bias; - this.xWatsonLoggingOptOut = federatedQueryOptions.xWatsonLoggingOptOut; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionIds the collectionIds - */ - public Builder(String environmentId, String collectionIds) { - this.environmentId = environmentId; - this.collectionIds = collectionIds; - } - - /** - * Builds a FederatedQueryOptions. - * - * @return the new FederatedQueryOptions instance - */ - public FederatedQueryOptions build() { - return new FederatedQueryOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the FederatedQueryOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionIds. - * - * @param collectionIds the collectionIds - * @return the FederatedQueryOptions builder - */ - public Builder collectionIds(String collectionIds) { - this.collectionIds = collectionIds; - return this; - } - - /** - * Set the filter. - * - * @param filter the filter - * @return the FederatedQueryOptions builder - */ - public Builder filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set the query. - * - * @param query the query - * @return the FederatedQueryOptions builder - */ - public Builder query(String query) { - this.query = query; - return this; - } - - /** - * Set the naturalLanguageQuery. - * - * @param naturalLanguageQuery the naturalLanguageQuery - * @return the FederatedQueryOptions builder - */ - public Builder naturalLanguageQuery(String naturalLanguageQuery) { - this.naturalLanguageQuery = naturalLanguageQuery; - return this; - } - - /** - * Set the passages. - * - * @param passages the passages - * @return the FederatedQueryOptions builder - */ - public Builder passages(Boolean passages) { - this.passages = passages; - return this; - } - - /** - * Set the aggregation. - * - * @param aggregation the aggregation - * @return the FederatedQueryOptions builder - */ - public Builder aggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Set the count. - * - * @param count the count - * @return the FederatedQueryOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - - /** - * Set the xReturn. - * - * @param xReturn the xReturn - * @return the FederatedQueryOptions builder - */ - public Builder xReturn(String xReturn) { - this.xReturn = xReturn; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the FederatedQueryOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - - /** - * Set the sort. - * - * @param sort the sort - * @return the FederatedQueryOptions builder - */ - public Builder sort(String sort) { - this.sort = sort; - return this; - } - - /** - * Set the highlight. - * - * @param highlight the highlight - * @return the FederatedQueryOptions builder - */ - public Builder highlight(Boolean highlight) { - this.highlight = highlight; - return this; - } - - /** - * Set the passagesFields. - * - * @param passagesFields the passagesFields - * @return the FederatedQueryOptions builder - */ - public Builder passagesFields(String passagesFields) { - this.passagesFields = passagesFields; - return this; - } - - /** - * Set the passagesCount. - * - * @param passagesCount the passagesCount - * @return the FederatedQueryOptions builder - */ - public Builder passagesCount(long passagesCount) { - this.passagesCount = passagesCount; - return this; - } - - /** - * Set the passagesCharacters. - * - * @param passagesCharacters the passagesCharacters - * @return the FederatedQueryOptions builder - */ - public Builder passagesCharacters(long passagesCharacters) { - this.passagesCharacters = passagesCharacters; - return this; - } - - /** - * Set the deduplicate. - * - * @param deduplicate the deduplicate - * @return the FederatedQueryOptions builder - */ - public Builder deduplicate(Boolean deduplicate) { - this.deduplicate = deduplicate; - return this; - } - - /** - * Set the deduplicateField. - * - * @param deduplicateField the deduplicateField - * @return the FederatedQueryOptions builder - */ - public Builder deduplicateField(String deduplicateField) { - this.deduplicateField = deduplicateField; - return this; - } - - /** - * Set the similar. - * - * @param similar the similar - * @return the FederatedQueryOptions builder - */ - public Builder similar(Boolean similar) { - this.similar = similar; - return this; - } - - /** - * Set the similarDocumentIds. - * - * @param similarDocumentIds the similarDocumentIds - * @return the FederatedQueryOptions builder - */ - public Builder similarDocumentIds(String similarDocumentIds) { - this.similarDocumentIds = similarDocumentIds; - return this; - } - - /** - * Set the similarFields. - * - * @param similarFields the similarFields - * @return the FederatedQueryOptions builder - */ - public Builder similarFields(String similarFields) { - this.similarFields = similarFields; - return this; - } - - /** - * Set the bias. - * - * @param bias the bias - * @return the FederatedQueryOptions builder - */ - public Builder bias(String bias) { - this.bias = bias; - return this; - } - - /** - * Set the xWatsonLoggingOptOut. - * - * @param xWatsonLoggingOptOut the xWatsonLoggingOptOut - * @return the FederatedQueryOptions builder - */ - public Builder xWatsonLoggingOptOut(Boolean xWatsonLoggingOptOut) { - this.xWatsonLoggingOptOut = xWatsonLoggingOptOut; - return this; - } - } - - protected FederatedQueryOptions() {} - - protected FederatedQueryOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.collectionIds, "collectionIds cannot be null"); - environmentId = builder.environmentId; - collectionIds = builder.collectionIds; - filter = builder.filter; - query = builder.query; - naturalLanguageQuery = builder.naturalLanguageQuery; - passages = builder.passages; - aggregation = builder.aggregation; - count = builder.count; - xReturn = builder.xReturn; - offset = builder.offset; - sort = builder.sort; - highlight = builder.highlight; - passagesFields = builder.passagesFields; - passagesCount = builder.passagesCount; - passagesCharacters = builder.passagesCharacters; - deduplicate = builder.deduplicate; - deduplicateField = builder.deduplicateField; - similar = builder.similar; - similarDocumentIds = builder.similarDocumentIds; - similarFields = builder.similarFields; - bias = builder.bias; - xWatsonLoggingOptOut = builder.xWatsonLoggingOptOut; - } - - /** - * New builder. - * - * @return a FederatedQueryOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionIds. - * - *

A comma-separated list of collection IDs to be queried against. - * - * @return the collectionIds - */ - public String collectionIds() { - return collectionIds; - } - - /** - * Gets the filter. - * - *

A cacheable query that excludes documents that don't mention the query content. Filter - * searches are better for metadata-type searches and for assessing the concepts in the data set. - * - * @return the filter - */ - public String filter() { - return filter; - } - - /** - * Gets the query. - * - *

A query search returns all documents in your data set with full enrichments and full text, - * but with the most relevant documents listed first. Use a query search when you want to find the - * most relevant search results. - * - * @return the query - */ - public String query() { - return query; - } - - /** - * Gets the naturalLanguageQuery. - * - *

A natural language query that returns relevant documents by utilizing training data and - * natural language understanding. - * - * @return the naturalLanguageQuery - */ - public String naturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the passages. - * - *

A passages query that returns the most relevant passages from the results. - * - * @return the passages - */ - public Boolean passages() { - return passages; - } - - /** - * Gets the aggregation. - * - *

An aggregation search that returns an exact answer by combining query search with filters. - * Useful for applications to build lists, tables, and time series. For a full list of possible - * aggregations, see the Query reference. - * - * @return the aggregation - */ - public String aggregation() { - return aggregation; - } - - /** - * Gets the count. - * - *

Number of results to return. - * - * @return the count - */ - public Long count() { - return count; - } - - /** - * Gets the xReturn. - * - *

A comma-separated list of the portion of the document hierarchy to return. - * - * @return the xReturn - */ - public String xReturn() { - return xReturn; - } - - /** - * Gets the offset. - * - *

The number of query results to skip at the beginning. For example, if the total number of - * results that are returned is 10 and the offset is 8, it returns the last two results. - * - * @return the offset - */ - public Long offset() { - return offset; - } - - /** - * Gets the sort. - * - *

A comma-separated list of fields in the document to sort on. You can optionally specify a - * sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending - * is the default sort direction if no prefix is specified. This parameter cannot be used in the - * same query as the **bias** parameter. - * - * @return the sort - */ - public String sort() { - return sort; - } - - /** - * Gets the highlight. - * - *

When true, a highlight field is returned for each result which contains the fields which - * match the query with `<em></em>` tags around the matching query terms. - * - * @return the highlight - */ - public Boolean highlight() { - return highlight; - } - - /** - * Gets the passagesFields. - * - *

A comma-separated list of fields that passages are drawn from. If this parameter not - * specified, then all top-level fields are included. - * - * @return the passagesFields - */ - public String passagesFields() { - return passagesFields; - } - - /** - * Gets the passagesCount. - * - *

The maximum number of passages to return. The search returns fewer passages if the requested - * total is not found. The default is `10`. The maximum is `100`. - * - * @return the passagesCount - */ - public Long passagesCount() { - return passagesCount; - } - - /** - * Gets the passagesCharacters. - * - *

The approximate number of characters that any one passage will have. - * - * @return the passagesCharacters - */ - public Long passagesCharacters() { - return passagesCharacters; - } - - /** - * Gets the deduplicate. - * - *

When `true`, and used with a Watson Discovery News collection, duplicate results (based on - * the contents of the **title** field) are removed. Duplicate comparison is limited to the - * current query only; **offset** is not considered. This parameter is currently Beta - * functionality. - * - * @return the deduplicate - */ - public Boolean deduplicate() { - return deduplicate; - } - - /** - * Gets the deduplicateField. - * - *

When specified, duplicate results based on the field specified are removed from the returned - * results. Duplicate comparison is limited to the current query only, **offset** is not - * considered. This parameter is currently Beta functionality. - * - * @return the deduplicateField - */ - public String deduplicateField() { - return deduplicateField; - } - - /** - * Gets the similar. - * - *

When `true`, results are returned based on their similarity to the document IDs specified in - * the **similar.document_ids** parameter. - * - * @return the similar - */ - public Boolean similar() { - return similar; - } - - /** - * Gets the similarDocumentIds. - * - *

A comma-separated list of document IDs to find similar documents. - * - *

**Tip:** Include the **natural_language_query** parameter to expand the scope of the - * document similarity search with the natural language query. Other query parameters, such as - * **filter** and **query**, are subsequently applied and reduce the scope. - * - * @return the similarDocumentIds - */ - public String similarDocumentIds() { - return similarDocumentIds; - } - - /** - * Gets the similarFields. - * - *

A comma-separated list of field names that are used as a basis for comparison to identify - * similar documents. If not specified, the entire document is used for comparison. - * - * @return the similarFields - */ - public String similarFields() { - return similarFields; - } - - /** - * Gets the bias. - * - *

Field which the returned results will be biased against. The specified field must be either - * a **date** or **number** format. When a **date** type field is specified returned results are - * biased towards field values closer to the current date. When a **number** type field is - * specified, returned results are biased towards higher field values. This parameter cannot be - * used in the same query as the **sort** parameter. - * - * @return the bias - */ - public String bias() { - return bias; - } - - /** - * Gets the xWatsonLoggingOptOut. - * - *

If `true`, queries are not stored in the Discovery **Logs** endpoint. - * - * @return the xWatsonLoggingOptOut - */ - public Boolean xWatsonLoggingOptOut() { - return xWatsonLoggingOptOut; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Field.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Field.java deleted file mode 100644 index cfddb1db04d..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Field.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing field details. */ -public class Field extends GenericModel { - - /** The type of the field. */ - public interface Type { - /** nested. */ - String NESTED = "nested"; - /** string. */ - String STRING = "string"; - /** date. */ - String DATE = "date"; - /** long. */ - String X_LONG = "long"; - /** integer. */ - String INTEGER = "integer"; - /** short. */ - String X_SHORT = "short"; - /** byte. */ - String X_BYTE = "byte"; - /** double. */ - String X_DOUBLE = "double"; - /** float. */ - String X_FLOAT = "float"; - /** boolean. */ - String X_BOOLEAN = "boolean"; - /** binary. */ - String BINARY = "binary"; - } - - protected String field; - protected String type; - - protected Field() {} - - /** - * Gets the field. - * - *

The name of the field. - * - * @return the field - */ - public String getField() { - return field; - } - - /** - * Gets the type. - * - *

The type of the field. - * - * @return the type - */ - public String getType() { - return type; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FontSetting.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FontSetting.java deleted file mode 100644 index ac4216c9afd..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/FontSetting.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Font matching configuration. */ -public class FontSetting extends GenericModel { - - protected Long level; - - @SerializedName("min_size") - protected Long minSize; - - @SerializedName("max_size") - protected Long maxSize; - - protected Boolean bold; - protected Boolean italic; - protected String name; - - /** Builder. */ - public static class Builder { - private Long level; - private Long minSize; - private Long maxSize; - private Boolean bold; - private Boolean italic; - private String name; - - /** - * Instantiates a new Builder from an existing FontSetting instance. - * - * @param fontSetting the instance to initialize the Builder with - */ - private Builder(FontSetting fontSetting) { - this.level = fontSetting.level; - this.minSize = fontSetting.minSize; - this.maxSize = fontSetting.maxSize; - this.bold = fontSetting.bold; - this.italic = fontSetting.italic; - this.name = fontSetting.name; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a FontSetting. - * - * @return the new FontSetting instance - */ - public FontSetting build() { - return new FontSetting(this); - } - - /** - * Set the level. - * - * @param level the level - * @return the FontSetting builder - */ - public Builder level(long level) { - this.level = level; - return this; - } - - /** - * Set the minSize. - * - * @param minSize the minSize - * @return the FontSetting builder - */ - public Builder minSize(long minSize) { - this.minSize = minSize; - return this; - } - - /** - * Set the maxSize. - * - * @param maxSize the maxSize - * @return the FontSetting builder - */ - public Builder maxSize(long maxSize) { - this.maxSize = maxSize; - return this; - } - - /** - * Set the bold. - * - * @param bold the bold - * @return the FontSetting builder - */ - public Builder bold(Boolean bold) { - this.bold = bold; - return this; - } - - /** - * Set the italic. - * - * @param italic the italic - * @return the FontSetting builder - */ - public Builder italic(Boolean italic) { - this.italic = italic; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the FontSetting builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - } - - protected FontSetting() {} - - protected FontSetting(Builder builder) { - level = builder.level; - minSize = builder.minSize; - maxSize = builder.maxSize; - bold = builder.bold; - italic = builder.italic; - name = builder.name; - } - - /** - * New builder. - * - * @return a FontSetting builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the level. - * - *

The HTML heading level that any content with the matching font is converted to. - * - * @return the level - */ - public Long level() { - return level; - } - - /** - * Gets the minSize. - * - *

The minimum size of the font to match. - * - * @return the minSize - */ - public Long minSize() { - return minSize; - } - - /** - * Gets the maxSize. - * - *

The maximum size of the font to match. - * - * @return the maxSize - */ - public Long maxSize() { - return maxSize; - } - - /** - * Gets the bold. - * - *

When `true`, the font is matched if it is bold. - * - * @return the bold - */ - public Boolean bold() { - return bold; - } - - /** - * Gets the italic. - * - *

When `true`, the font is matched if it is italic. - * - * @return the italic - */ - public Boolean italic() { - return italic; - } - - /** - * Gets the name. - * - *

The name of the font. - * - * @return the name - */ - public String name() { - return name; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Gateway.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Gateway.java deleted file mode 100644 index 15ccc223cd9..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Gateway.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object describing a specific gateway. */ -public class Gateway extends GenericModel { - - /** - * The current status of the gateway. `connected` means the gateway is connected to the remotly - * installed gateway. `idle` means this gateway is not currently in use. - */ - public interface Status { - /** connected. */ - String CONNECTED = "connected"; - /** idle. */ - String IDLE = "idle"; - } - - @SerializedName("gateway_id") - protected String gatewayId; - - protected String name; - protected String status; - protected String token; - - @SerializedName("token_id") - protected String tokenId; - - protected Gateway() {} - - /** - * Gets the gatewayId. - * - *

The gateway ID of the gateway. - * - * @return the gatewayId - */ - public String getGatewayId() { - return gatewayId; - } - - /** - * Gets the name. - * - *

The user defined name of the gateway. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the status. - * - *

The current status of the gateway. `connected` means the gateway is connected to the remotly - * installed gateway. `idle` means this gateway is not currently in use. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the token. - * - *

The generated **token** for this gateway. The value of this field is used when configuring - * the remotly installed gateway. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Gets the tokenId. - * - *

The generated **token_id** for this gateway. The value of this field is used when - * configuring the remotly installed gateway. - * - * @return the tokenId - */ - public String getTokenId() { - return tokenId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GatewayList.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GatewayList.java deleted file mode 100644 index 56a05e17d53..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GatewayList.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Object containing gateways array. */ -public class GatewayList extends GenericModel { - - protected List gateways; - - protected GatewayList() {} - - /** - * Gets the gateways. - * - *

Array of configured gateway connections. - * - * @return the gateways - */ - public List getGateways() { - return gateways; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetAutocompletionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetAutocompletionOptions.java deleted file mode 100644 index 1b19f9a5b0c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetAutocompletionOptions.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getAutocompletion options. */ -public class GetAutocompletionOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String prefix; - protected String field; - protected Long count; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String prefix; - private String field; - private Long count; - - /** - * Instantiates a new Builder from an existing GetAutocompletionOptions instance. - * - * @param getAutocompletionOptions the instance to initialize the Builder with - */ - private Builder(GetAutocompletionOptions getAutocompletionOptions) { - this.environmentId = getAutocompletionOptions.environmentId; - this.collectionId = getAutocompletionOptions.collectionId; - this.prefix = getAutocompletionOptions.prefix; - this.field = getAutocompletionOptions.field; - this.count = getAutocompletionOptions.count; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param prefix the prefix - */ - public Builder(String environmentId, String collectionId, String prefix) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.prefix = prefix; - } - - /** - * Builds a GetAutocompletionOptions. - * - * @return the new GetAutocompletionOptions instance - */ - public GetAutocompletionOptions build() { - return new GetAutocompletionOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetAutocompletionOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the GetAutocompletionOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the prefix. - * - * @param prefix the prefix - * @return the GetAutocompletionOptions builder - */ - public Builder prefix(String prefix) { - this.prefix = prefix; - return this; - } - - /** - * Set the field. - * - * @param field the field - * @return the GetAutocompletionOptions builder - */ - public Builder field(String field) { - this.field = field; - return this; - } - - /** - * Set the count. - * - * @param count the count - * @return the GetAutocompletionOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - } - - protected GetAutocompletionOptions() {} - - protected GetAutocompletionOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.prefix, "prefix cannot be null"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - prefix = builder.prefix; - field = builder.field; - count = builder.count; - } - - /** - * New builder. - * - * @return a GetAutocompletionOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the prefix. - * - *

The prefix to use for autocompletion. For example, the prefix `Ho` could autocomplete to - * `hot`, `housing`, or `how`. - * - * @return the prefix - */ - public String prefix() { - return prefix; - } - - /** - * Gets the field. - * - *

The field in the result documents that autocompletion suggestions are identified from. - * - * @return the field - */ - public String field() { - return field; - } - - /** - * Gets the count. - * - *

The number of autocompletion suggestions to return. - * - * @return the count - */ - public Long count() { - return count; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetConfigurationOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetConfigurationOptions.java deleted file mode 100644 index fd8469b0934..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetConfigurationOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getConfiguration options. */ -public class GetConfigurationOptions extends GenericModel { - - protected String environmentId; - protected String configurationId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String configurationId; - - /** - * Instantiates a new Builder from an existing GetConfigurationOptions instance. - * - * @param getConfigurationOptions the instance to initialize the Builder with - */ - private Builder(GetConfigurationOptions getConfigurationOptions) { - this.environmentId = getConfigurationOptions.environmentId; - this.configurationId = getConfigurationOptions.configurationId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param configurationId the configurationId - */ - public Builder(String environmentId, String configurationId) { - this.environmentId = environmentId; - this.configurationId = configurationId; - } - - /** - * Builds a GetConfigurationOptions. - * - * @return the new GetConfigurationOptions instance - */ - public GetConfigurationOptions build() { - return new GetConfigurationOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetConfigurationOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the configurationId. - * - * @param configurationId the configurationId - * @return the GetConfigurationOptions builder - */ - public Builder configurationId(String configurationId) { - this.configurationId = configurationId; - return this; - } - } - - protected GetConfigurationOptions() {} - - protected GetConfigurationOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.configurationId, "configurationId cannot be empty"); - environmentId = builder.environmentId; - configurationId = builder.configurationId; - } - - /** - * New builder. - * - * @return a GetConfigurationOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the configurationId. - * - *

The ID of the configuration. - * - * @return the configurationId - */ - public String configurationId() { - return configurationId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetCredentialsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetCredentialsOptions.java deleted file mode 100644 index 51d5e9f1aad..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetCredentialsOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getCredentials options. */ -public class GetCredentialsOptions extends GenericModel { - - protected String environmentId; - protected String credentialId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String credentialId; - - /** - * Instantiates a new Builder from an existing GetCredentialsOptions instance. - * - * @param getCredentialsOptions the instance to initialize the Builder with - */ - private Builder(GetCredentialsOptions getCredentialsOptions) { - this.environmentId = getCredentialsOptions.environmentId; - this.credentialId = getCredentialsOptions.credentialId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param credentialId the credentialId - */ - public Builder(String environmentId, String credentialId) { - this.environmentId = environmentId; - this.credentialId = credentialId; - } - - /** - * Builds a GetCredentialsOptions. - * - * @return the new GetCredentialsOptions instance - */ - public GetCredentialsOptions build() { - return new GetCredentialsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetCredentialsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the credentialId. - * - * @param credentialId the credentialId - * @return the GetCredentialsOptions builder - */ - public Builder credentialId(String credentialId) { - this.credentialId = credentialId; - return this; - } - } - - protected GetCredentialsOptions() {} - - protected GetCredentialsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.credentialId, "credentialId cannot be empty"); - environmentId = builder.environmentId; - credentialId = builder.credentialId; - } - - /** - * New builder. - * - * @return a GetCredentialsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the credentialId. - * - *

The unique identifier for a set of source credentials. - * - * @return the credentialId - */ - public String credentialId() { - return credentialId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetDocumentStatusOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetDocumentStatusOptions.java deleted file mode 100644 index 9413d33d180..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetDocumentStatusOptions.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getDocumentStatus options. */ -public class GetDocumentStatusOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String documentId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - 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.environmentId = getDocumentStatusOptions.environmentId; - this.collectionId = getDocumentStatusOptions.collectionId; - this.documentId = getDocumentStatusOptions.documentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param documentId the documentId - */ - public Builder(String environmentId, String collectionId, String documentId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.documentId = documentId; - } - - /** - * Builds a GetDocumentStatusOptions. - * - * @return the new GetDocumentStatusOptions instance - */ - public GetDocumentStatusOptions build() { - return new GetDocumentStatusOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetDocumentStatusOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the GetDocumentStatusOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the GetDocumentStatusOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - } - - protected GetDocumentStatusOptions() {} - - protected GetDocumentStatusOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.documentId, "documentId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - documentId = builder.documentId; - } - - /** - * New builder. - * - * @return a GetDocumentStatusOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the documentId. - * - *

The ID of the document. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetEnvironmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetEnvironmentOptions.java deleted file mode 100644 index f59478bbfdd..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetEnvironmentOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getEnvironment options. */ -public class GetEnvironmentOptions extends GenericModel { - - protected String environmentId; - - /** Builder. */ - public static class Builder { - private String environmentId; - - /** - * Instantiates a new Builder from an existing GetEnvironmentOptions instance. - * - * @param getEnvironmentOptions the instance to initialize the Builder with - */ - private Builder(GetEnvironmentOptions getEnvironmentOptions) { - this.environmentId = getEnvironmentOptions.environmentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a GetEnvironmentOptions. - * - * @return the new GetEnvironmentOptions instance - */ - public GetEnvironmentOptions build() { - return new GetEnvironmentOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetEnvironmentOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - } - - protected GetEnvironmentOptions() {} - - protected GetEnvironmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - } - - /** - * New builder. - * - * @return a GetEnvironmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetGatewayOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetGatewayOptions.java deleted file mode 100644 index 886aaa62080..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetGatewayOptions.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getGateway options. */ -public class GetGatewayOptions extends GenericModel { - - protected String environmentId; - protected String gatewayId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String gatewayId; - - /** - * Instantiates a new Builder from an existing GetGatewayOptions instance. - * - * @param getGatewayOptions the instance to initialize the Builder with - */ - private Builder(GetGatewayOptions getGatewayOptions) { - this.environmentId = getGatewayOptions.environmentId; - this.gatewayId = getGatewayOptions.gatewayId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param gatewayId the gatewayId - */ - public Builder(String environmentId, String gatewayId) { - this.environmentId = environmentId; - this.gatewayId = gatewayId; - } - - /** - * Builds a GetGatewayOptions. - * - * @return the new GetGatewayOptions instance - */ - public GetGatewayOptions build() { - return new GetGatewayOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetGatewayOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the gatewayId. - * - * @param gatewayId the gatewayId - * @return the GetGatewayOptions builder - */ - public Builder gatewayId(String gatewayId) { - this.gatewayId = gatewayId; - return this; - } - } - - protected GetGatewayOptions() {} - - protected GetGatewayOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.gatewayId, "gatewayId cannot be empty"); - environmentId = builder.environmentId; - gatewayId = builder.gatewayId; - } - - /** - * New builder. - * - * @return a GetGatewayOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the gatewayId. - * - *

The requested gateway ID. - * - * @return the gatewayId - */ - public String gatewayId() { - return gatewayId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsEventRateOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsEventRateOptions.java deleted file mode 100644 index 7778a17f760..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsEventRateOptions.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** The getMetricsEventRate options. */ -public class GetMetricsEventRateOptions extends GenericModel { - - /** The type of result to consider when calculating the metric. */ - public interface ResultType { - /** document. */ - String DOCUMENT = "document"; - } - - protected Date startTime; - protected Date endTime; - protected String resultType; - - /** Builder. */ - public static class Builder { - private Date startTime; - private Date endTime; - private String resultType; - - /** - * Instantiates a new Builder from an existing GetMetricsEventRateOptions instance. - * - * @param getMetricsEventRateOptions the instance to initialize the Builder with - */ - private Builder(GetMetricsEventRateOptions getMetricsEventRateOptions) { - this.startTime = getMetricsEventRateOptions.startTime; - this.endTime = getMetricsEventRateOptions.endTime; - this.resultType = getMetricsEventRateOptions.resultType; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a GetMetricsEventRateOptions. - * - * @return the new GetMetricsEventRateOptions instance - */ - public GetMetricsEventRateOptions build() { - return new GetMetricsEventRateOptions(this); - } - - /** - * Set the startTime. - * - * @param startTime the startTime - * @return the GetMetricsEventRateOptions builder - */ - public Builder startTime(Date startTime) { - this.startTime = startTime; - return this; - } - - /** - * Set the endTime. - * - * @param endTime the endTime - * @return the GetMetricsEventRateOptions builder - */ - public Builder endTime(Date endTime) { - this.endTime = endTime; - return this; - } - - /** - * Set the resultType. - * - * @param resultType the resultType - * @return the GetMetricsEventRateOptions builder - */ - public Builder resultType(String resultType) { - this.resultType = resultType; - return this; - } - } - - protected GetMetricsEventRateOptions() {} - - protected GetMetricsEventRateOptions(Builder builder) { - startTime = builder.startTime; - endTime = builder.endTime; - resultType = builder.resultType; - } - - /** - * New builder. - * - * @return a GetMetricsEventRateOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the startTime. - * - *

Metric is computed from data recorded after this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the startTime - */ - public Date startTime() { - return startTime; - } - - /** - * Gets the endTime. - * - *

Metric is computed from data recorded before this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the endTime - */ - public Date endTime() { - return endTime; - } - - /** - * Gets the resultType. - * - *

The type of result to consider when calculating the metric. - * - * @return the resultType - */ - public String resultType() { - return resultType; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryEventOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryEventOptions.java deleted file mode 100644 index fb2abf12342..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryEventOptions.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** The getMetricsQueryEvent options. */ -public class GetMetricsQueryEventOptions extends GenericModel { - - /** The type of result to consider when calculating the metric. */ - public interface ResultType { - /** document. */ - String DOCUMENT = "document"; - } - - protected Date startTime; - protected Date endTime; - protected String resultType; - - /** Builder. */ - public static class Builder { - private Date startTime; - private Date endTime; - private String resultType; - - /** - * Instantiates a new Builder from an existing GetMetricsQueryEventOptions instance. - * - * @param getMetricsQueryEventOptions the instance to initialize the Builder with - */ - private Builder(GetMetricsQueryEventOptions getMetricsQueryEventOptions) { - this.startTime = getMetricsQueryEventOptions.startTime; - this.endTime = getMetricsQueryEventOptions.endTime; - this.resultType = getMetricsQueryEventOptions.resultType; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a GetMetricsQueryEventOptions. - * - * @return the new GetMetricsQueryEventOptions instance - */ - public GetMetricsQueryEventOptions build() { - return new GetMetricsQueryEventOptions(this); - } - - /** - * Set the startTime. - * - * @param startTime the startTime - * @return the GetMetricsQueryEventOptions builder - */ - public Builder startTime(Date startTime) { - this.startTime = startTime; - return this; - } - - /** - * Set the endTime. - * - * @param endTime the endTime - * @return the GetMetricsQueryEventOptions builder - */ - public Builder endTime(Date endTime) { - this.endTime = endTime; - return this; - } - - /** - * Set the resultType. - * - * @param resultType the resultType - * @return the GetMetricsQueryEventOptions builder - */ - public Builder resultType(String resultType) { - this.resultType = resultType; - return this; - } - } - - protected GetMetricsQueryEventOptions() {} - - protected GetMetricsQueryEventOptions(Builder builder) { - startTime = builder.startTime; - endTime = builder.endTime; - resultType = builder.resultType; - } - - /** - * New builder. - * - * @return a GetMetricsQueryEventOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the startTime. - * - *

Metric is computed from data recorded after this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the startTime - */ - public Date startTime() { - return startTime; - } - - /** - * Gets the endTime. - * - *

Metric is computed from data recorded before this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the endTime - */ - public Date endTime() { - return endTime; - } - - /** - * Gets the resultType. - * - *

The type of result to consider when calculating the metric. - * - * @return the resultType - */ - public String resultType() { - return resultType; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryNoResultsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryNoResultsOptions.java deleted file mode 100644 index 73aa50c1df5..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryNoResultsOptions.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** The getMetricsQueryNoResults options. */ -public class GetMetricsQueryNoResultsOptions extends GenericModel { - - /** The type of result to consider when calculating the metric. */ - public interface ResultType { - /** document. */ - String DOCUMENT = "document"; - } - - protected Date startTime; - protected Date endTime; - protected String resultType; - - /** Builder. */ - public static class Builder { - private Date startTime; - private Date endTime; - private String resultType; - - /** - * Instantiates a new Builder from an existing GetMetricsQueryNoResultsOptions instance. - * - * @param getMetricsQueryNoResultsOptions the instance to initialize the Builder with - */ - private Builder(GetMetricsQueryNoResultsOptions getMetricsQueryNoResultsOptions) { - this.startTime = getMetricsQueryNoResultsOptions.startTime; - this.endTime = getMetricsQueryNoResultsOptions.endTime; - this.resultType = getMetricsQueryNoResultsOptions.resultType; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a GetMetricsQueryNoResultsOptions. - * - * @return the new GetMetricsQueryNoResultsOptions instance - */ - public GetMetricsQueryNoResultsOptions build() { - return new GetMetricsQueryNoResultsOptions(this); - } - - /** - * Set the startTime. - * - * @param startTime the startTime - * @return the GetMetricsQueryNoResultsOptions builder - */ - public Builder startTime(Date startTime) { - this.startTime = startTime; - return this; - } - - /** - * Set the endTime. - * - * @param endTime the endTime - * @return the GetMetricsQueryNoResultsOptions builder - */ - public Builder endTime(Date endTime) { - this.endTime = endTime; - return this; - } - - /** - * Set the resultType. - * - * @param resultType the resultType - * @return the GetMetricsQueryNoResultsOptions builder - */ - public Builder resultType(String resultType) { - this.resultType = resultType; - return this; - } - } - - protected GetMetricsQueryNoResultsOptions() {} - - protected GetMetricsQueryNoResultsOptions(Builder builder) { - startTime = builder.startTime; - endTime = builder.endTime; - resultType = builder.resultType; - } - - /** - * New builder. - * - * @return a GetMetricsQueryNoResultsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the startTime. - * - *

Metric is computed from data recorded after this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the startTime - */ - public Date startTime() { - return startTime; - } - - /** - * Gets the endTime. - * - *

Metric is computed from data recorded before this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the endTime - */ - public Date endTime() { - return endTime; - } - - /** - * Gets the resultType. - * - *

The type of result to consider when calculating the metric. - * - * @return the resultType - */ - public String resultType() { - return resultType; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryOptions.java deleted file mode 100644 index 6e9260b4907..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryOptions.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** The getMetricsQuery options. */ -public class GetMetricsQueryOptions extends GenericModel { - - /** The type of result to consider when calculating the metric. */ - public interface ResultType { - /** document. */ - String DOCUMENT = "document"; - } - - protected Date startTime; - protected Date endTime; - protected String resultType; - - /** Builder. */ - public static class Builder { - private Date startTime; - private Date endTime; - private String resultType; - - /** - * Instantiates a new Builder from an existing GetMetricsQueryOptions instance. - * - * @param getMetricsQueryOptions the instance to initialize the Builder with - */ - private Builder(GetMetricsQueryOptions getMetricsQueryOptions) { - this.startTime = getMetricsQueryOptions.startTime; - this.endTime = getMetricsQueryOptions.endTime; - this.resultType = getMetricsQueryOptions.resultType; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a GetMetricsQueryOptions. - * - * @return the new GetMetricsQueryOptions instance - */ - public GetMetricsQueryOptions build() { - return new GetMetricsQueryOptions(this); - } - - /** - * Set the startTime. - * - * @param startTime the startTime - * @return the GetMetricsQueryOptions builder - */ - public Builder startTime(Date startTime) { - this.startTime = startTime; - return this; - } - - /** - * Set the endTime. - * - * @param endTime the endTime - * @return the GetMetricsQueryOptions builder - */ - public Builder endTime(Date endTime) { - this.endTime = endTime; - return this; - } - - /** - * Set the resultType. - * - * @param resultType the resultType - * @return the GetMetricsQueryOptions builder - */ - public Builder resultType(String resultType) { - this.resultType = resultType; - return this; - } - } - - protected GetMetricsQueryOptions() {} - - protected GetMetricsQueryOptions(Builder builder) { - startTime = builder.startTime; - endTime = builder.endTime; - resultType = builder.resultType; - } - - /** - * New builder. - * - * @return a GetMetricsQueryOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the startTime. - * - *

Metric is computed from data recorded after this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the startTime - */ - public Date startTime() { - return startTime; - } - - /** - * Gets the endTime. - * - *

Metric is computed from data recorded before this timestamp; must be in - * `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the endTime - */ - public Date endTime() { - return endTime; - } - - /** - * Gets the resultType. - * - *

The type of result to consider when calculating the metric. - * - * @return the resultType - */ - public String resultType() { - return resultType; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryTokenEventOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryTokenEventOptions.java deleted file mode 100644 index 8d7e337e1c2..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryTokenEventOptions.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getMetricsQueryTokenEvent options. */ -public class GetMetricsQueryTokenEventOptions extends GenericModel { - - protected Long count; - - /** Builder. */ - public static class Builder { - private Long count; - - /** - * Instantiates a new Builder from an existing GetMetricsQueryTokenEventOptions instance. - * - * @param getMetricsQueryTokenEventOptions the instance to initialize the Builder with - */ - private Builder(GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptions) { - this.count = getMetricsQueryTokenEventOptions.count; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a GetMetricsQueryTokenEventOptions. - * - * @return the new GetMetricsQueryTokenEventOptions instance - */ - public GetMetricsQueryTokenEventOptions build() { - return new GetMetricsQueryTokenEventOptions(this); - } - - /** - * Set the count. - * - * @param count the count - * @return the GetMetricsQueryTokenEventOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - } - - protected GetMetricsQueryTokenEventOptions() {} - - protected GetMetricsQueryTokenEventOptions(Builder builder) { - count = builder.count; - } - - /** - * New builder. - * - * @return a GetMetricsQueryTokenEventOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the count. - * - *

Number of results to return. The maximum for the **count** and **offset** values together in - * any one query is **10000**. - * - * @return the count - */ - public Long count() { - return count; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetStopwordListStatusOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetStopwordListStatusOptions.java deleted file mode 100644 index 5817bb3478d..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetStopwordListStatusOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getStopwordListStatus options. */ -public class GetStopwordListStatusOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing GetStopwordListStatusOptions instance. - * - * @param getStopwordListStatusOptions the instance to initialize the Builder with - */ - private Builder(GetStopwordListStatusOptions getStopwordListStatusOptions) { - this.environmentId = getStopwordListStatusOptions.environmentId; - this.collectionId = getStopwordListStatusOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a GetStopwordListStatusOptions. - * - * @return the new GetStopwordListStatusOptions instance - */ - public GetStopwordListStatusOptions build() { - return new GetStopwordListStatusOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetStopwordListStatusOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the GetStopwordListStatusOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected GetStopwordListStatusOptions() {} - - protected GetStopwordListStatusOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a GetStopwordListStatusOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTokenizationDictionaryStatusOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTokenizationDictionaryStatusOptions.java deleted file mode 100644 index c5e731db10b..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTokenizationDictionaryStatusOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getTokenizationDictionaryStatus options. */ -public class GetTokenizationDictionaryStatusOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing GetTokenizationDictionaryStatusOptions instance. - * - * @param getTokenizationDictionaryStatusOptions the instance to initialize the Builder with - */ - private Builder(GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptions) { - this.environmentId = getTokenizationDictionaryStatusOptions.environmentId; - this.collectionId = getTokenizationDictionaryStatusOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a GetTokenizationDictionaryStatusOptions. - * - * @return the new GetTokenizationDictionaryStatusOptions instance - */ - public GetTokenizationDictionaryStatusOptions build() { - return new GetTokenizationDictionaryStatusOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetTokenizationDictionaryStatusOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the GetTokenizationDictionaryStatusOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected GetTokenizationDictionaryStatusOptions() {} - - protected GetTokenizationDictionaryStatusOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a GetTokenizationDictionaryStatusOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTrainingDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTrainingDataOptions.java deleted file mode 100644 index cd79a265823..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTrainingDataOptions.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getTrainingData options. */ -public class GetTrainingDataOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - - /** - * Instantiates a new Builder from an existing GetTrainingDataOptions instance. - * - * @param getTrainingDataOptions the instance to initialize the Builder with - */ - private Builder(GetTrainingDataOptions getTrainingDataOptions) { - this.environmentId = getTrainingDataOptions.environmentId; - this.collectionId = getTrainingDataOptions.collectionId; - this.queryId = getTrainingDataOptions.queryId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - */ - public Builder(String environmentId, String collectionId, String queryId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - } - - /** - * Builds a GetTrainingDataOptions. - * - * @return the new GetTrainingDataOptions instance - */ - public GetTrainingDataOptions build() { - return new GetTrainingDataOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetTrainingDataOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the GetTrainingDataOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the GetTrainingDataOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - } - - protected GetTrainingDataOptions() {} - - protected GetTrainingDataOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - } - - /** - * New builder. - * - * @return a GetTrainingDataOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTrainingExampleOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTrainingExampleOptions.java deleted file mode 100644 index d8a2e3bc6de..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetTrainingExampleOptions.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getTrainingExample options. */ -public class GetTrainingExampleOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - protected String exampleId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - private String exampleId; - - /** - * Instantiates a new Builder from an existing GetTrainingExampleOptions instance. - * - * @param getTrainingExampleOptions the instance to initialize the Builder with - */ - private Builder(GetTrainingExampleOptions getTrainingExampleOptions) { - this.environmentId = getTrainingExampleOptions.environmentId; - this.collectionId = getTrainingExampleOptions.collectionId; - this.queryId = getTrainingExampleOptions.queryId; - this.exampleId = getTrainingExampleOptions.exampleId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - * @param exampleId the exampleId - */ - public Builder(String environmentId, String collectionId, String queryId, String exampleId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - this.exampleId = exampleId; - } - - /** - * Builds a GetTrainingExampleOptions. - * - * @return the new GetTrainingExampleOptions instance - */ - public GetTrainingExampleOptions build() { - return new GetTrainingExampleOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the GetTrainingExampleOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the GetTrainingExampleOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the GetTrainingExampleOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - - /** - * Set the exampleId. - * - * @param exampleId the exampleId - * @return the GetTrainingExampleOptions builder - */ - public Builder exampleId(String exampleId) { - this.exampleId = exampleId; - return this; - } - } - - protected GetTrainingExampleOptions() {} - - protected GetTrainingExampleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.exampleId, "exampleId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - exampleId = builder.exampleId; - } - - /** - * New builder. - * - * @return a GetTrainingExampleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } - - /** - * Gets the exampleId. - * - *

The ID of the document as it is indexed. - * - * @return the exampleId - */ - public String exampleId() { - return exampleId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/HtmlSettings.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/HtmlSettings.java deleted file mode 100644 index f50c2ac4db1..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/HtmlSettings.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** A list of HTML conversion settings. */ -public class HtmlSettings extends GenericModel { - - @SerializedName("exclude_tags_completely") - protected List excludeTagsCompletely; - - @SerializedName("exclude_tags_keep_content") - protected List excludeTagsKeepContent; - - @SerializedName("keep_content") - protected XPathPatterns keepContent; - - @SerializedName("exclude_content") - protected XPathPatterns excludeContent; - - @SerializedName("keep_tag_attributes") - protected List keepTagAttributes; - - @SerializedName("exclude_tag_attributes") - protected List excludeTagAttributes; - - /** Builder. */ - public static class Builder { - private List excludeTagsCompletely; - private List excludeTagsKeepContent; - private XPathPatterns keepContent; - private XPathPatterns excludeContent; - private List keepTagAttributes; - private List excludeTagAttributes; - - /** - * Instantiates a new Builder from an existing HtmlSettings instance. - * - * @param htmlSettings the instance to initialize the Builder with - */ - private Builder(HtmlSettings htmlSettings) { - this.excludeTagsCompletely = htmlSettings.excludeTagsCompletely; - this.excludeTagsKeepContent = htmlSettings.excludeTagsKeepContent; - this.keepContent = htmlSettings.keepContent; - this.excludeContent = htmlSettings.excludeContent; - this.keepTagAttributes = htmlSettings.keepTagAttributes; - this.excludeTagAttributes = htmlSettings.excludeTagAttributes; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a HtmlSettings. - * - * @return the new HtmlSettings instance - */ - public HtmlSettings build() { - return new HtmlSettings(this); - } - - /** - * Adds a new element to excludeTagsCompletely. - * - * @param excludeTagsCompletely the new element to be added - * @return the HtmlSettings builder - */ - public Builder addExcludeTagsCompletely(String excludeTagsCompletely) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - excludeTagsCompletely, "excludeTagsCompletely cannot be null"); - if (this.excludeTagsCompletely == null) { - this.excludeTagsCompletely = new ArrayList(); - } - this.excludeTagsCompletely.add(excludeTagsCompletely); - return this; - } - - /** - * Adds a new element to excludeTagsKeepContent. - * - * @param excludeTagsKeepContent the new element to be added - * @return the HtmlSettings builder - */ - public Builder addExcludeTagsKeepContent(String excludeTagsKeepContent) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - excludeTagsKeepContent, "excludeTagsKeepContent cannot be null"); - if (this.excludeTagsKeepContent == null) { - this.excludeTagsKeepContent = new ArrayList(); - } - this.excludeTagsKeepContent.add(excludeTagsKeepContent); - return this; - } - - /** - * Adds a new element to keepTagAttributes. - * - * @param keepTagAttributes the new element to be added - * @return the HtmlSettings builder - */ - public Builder addKeepTagAttributes(String keepTagAttributes) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - keepTagAttributes, "keepTagAttributes cannot be null"); - if (this.keepTagAttributes == null) { - this.keepTagAttributes = new ArrayList(); - } - this.keepTagAttributes.add(keepTagAttributes); - return this; - } - - /** - * Adds a new element to excludeTagAttributes. - * - * @param excludeTagAttributes the new element to be added - * @return the HtmlSettings builder - */ - public Builder addExcludeTagAttributes(String excludeTagAttributes) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - excludeTagAttributes, "excludeTagAttributes cannot be null"); - if (this.excludeTagAttributes == null) { - this.excludeTagAttributes = new ArrayList(); - } - this.excludeTagAttributes.add(excludeTagAttributes); - return this; - } - - /** - * Set the excludeTagsCompletely. Existing excludeTagsCompletely will be replaced. - * - * @param excludeTagsCompletely the excludeTagsCompletely - * @return the HtmlSettings builder - */ - public Builder excludeTagsCompletely(List excludeTagsCompletely) { - this.excludeTagsCompletely = excludeTagsCompletely; - return this; - } - - /** - * Set the excludeTagsKeepContent. Existing excludeTagsKeepContent will be replaced. - * - * @param excludeTagsKeepContent the excludeTagsKeepContent - * @return the HtmlSettings builder - */ - public Builder excludeTagsKeepContent(List excludeTagsKeepContent) { - this.excludeTagsKeepContent = excludeTagsKeepContent; - return this; - } - - /** - * Set the keepContent. - * - * @param keepContent the keepContent - * @return the HtmlSettings builder - */ - public Builder keepContent(XPathPatterns keepContent) { - this.keepContent = keepContent; - return this; - } - - /** - * Set the excludeContent. - * - * @param excludeContent the excludeContent - * @return the HtmlSettings builder - */ - public Builder excludeContent(XPathPatterns excludeContent) { - this.excludeContent = excludeContent; - return this; - } - - /** - * Set the keepTagAttributes. Existing keepTagAttributes will be replaced. - * - * @param keepTagAttributes the keepTagAttributes - * @return the HtmlSettings builder - */ - public Builder keepTagAttributes(List keepTagAttributes) { - this.keepTagAttributes = keepTagAttributes; - return this; - } - - /** - * Set the excludeTagAttributes. Existing excludeTagAttributes will be replaced. - * - * @param excludeTagAttributes the excludeTagAttributes - * @return the HtmlSettings builder - */ - public Builder excludeTagAttributes(List excludeTagAttributes) { - this.excludeTagAttributes = excludeTagAttributes; - return this; - } - } - - protected HtmlSettings() {} - - protected HtmlSettings(Builder builder) { - excludeTagsCompletely = builder.excludeTagsCompletely; - excludeTagsKeepContent = builder.excludeTagsKeepContent; - keepContent = builder.keepContent; - excludeContent = builder.excludeContent; - keepTagAttributes = builder.keepTagAttributes; - excludeTagAttributes = builder.excludeTagAttributes; - } - - /** - * New builder. - * - * @return a HtmlSettings builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the excludeTagsCompletely. - * - *

Array of HTML tags that are excluded completely. - * - * @return the excludeTagsCompletely - */ - public List excludeTagsCompletely() { - return excludeTagsCompletely; - } - - /** - * Gets the excludeTagsKeepContent. - * - *

Array of HTML tags which are excluded but still retain content. - * - * @return the excludeTagsKeepContent - */ - public List excludeTagsKeepContent() { - return excludeTagsKeepContent; - } - - /** - * Gets the keepContent. - * - *

Object containing an array of XPaths. - * - * @return the keepContent - */ - public XPathPatterns keepContent() { - return keepContent; - } - - /** - * Gets the excludeContent. - * - *

Object containing an array of XPaths. - * - * @return the excludeContent - */ - public XPathPatterns excludeContent() { - return excludeContent; - } - - /** - * Gets the keepTagAttributes. - * - *

An array of HTML tag attributes to keep in the converted document. - * - * @return the keepTagAttributes - */ - public List keepTagAttributes() { - return keepTagAttributes; - } - - /** - * Gets the excludeTagAttributes. - * - *

Array of HTML tag attributes to exclude. - * - * @return the excludeTagAttributes - */ - public List excludeTagAttributes() { - return excludeTagAttributes; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/IndexCapacity.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/IndexCapacity.java deleted file mode 100644 index 0b09d5d117f..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/IndexCapacity.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Details about the resource usage and capacity of the environment. */ -public class IndexCapacity extends GenericModel { - - protected EnvironmentDocuments documents; - - @SerializedName("disk_usage") - protected DiskUsage diskUsage; - - protected CollectionUsage collections; - - protected IndexCapacity() {} - - /** - * Gets the documents. - * - *

Summary of the document usage statistics for the environment. - * - * @return the documents - */ - public EnvironmentDocuments getDocuments() { - return documents; - } - - /** - * Gets the diskUsage. - * - *

Summary of the disk usage statistics for the environment. - * - * @return the diskUsage - */ - public DiskUsage getDiskUsage() { - return diskUsage; - } - - /** - * Gets the collections. - * - *

Summary of the collection usage in the environment. - * - * @return the collections - */ - public CollectionUsage getCollections() { - return collections; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsOptions.java deleted file mode 100644 index eff7f1a9bbb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listCollectionFields options. */ -public class ListCollectionFieldsOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing ListCollectionFieldsOptions instance. - * - * @param listCollectionFieldsOptions the instance to initialize the Builder with - */ - private Builder(ListCollectionFieldsOptions listCollectionFieldsOptions) { - this.environmentId = listCollectionFieldsOptions.environmentId; - this.collectionId = listCollectionFieldsOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a ListCollectionFieldsOptions. - * - * @return the new ListCollectionFieldsOptions instance - */ - public ListCollectionFieldsOptions build() { - return new ListCollectionFieldsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListCollectionFieldsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the ListCollectionFieldsOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected ListCollectionFieldsOptions() {} - - protected ListCollectionFieldsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a ListCollectionFieldsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsResponse.java deleted file mode 100644 index 7f4e21f19fb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsResponse.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** - * The list of fetched fields. - * - *

The fields are returned using a fully qualified name format, however, the format differs - * slightly from that used by the query operations. - * - *

* Fields which contain nested JSON objects are assigned a type of "nested". - * - *

* Fields which belong to a nested object are prefixed with `.properties` (for example, - * `warnings.properties.severity` means that the `warnings` object has a property called - * `severity`). - * - *

* Fields returned from the News collection are prefixed with - * `v{N}-fullnews-t3-{YEAR}.mappings` (for example, - * `v5-fullnews-t3-2016.mappings.text.properties.author`). - */ -public class ListCollectionFieldsResponse extends GenericModel { - - protected List fields; - - protected ListCollectionFieldsResponse() {} - - /** - * Gets the fields. - * - *

An array containing information about each field in the collections. - * - * @return the fields - */ - public List getFields() { - return fields; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionsOptions.java deleted file mode 100644 index 67fb0a0c67c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionsOptions.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listCollections options. */ -public class ListCollectionsOptions extends GenericModel { - - protected String environmentId; - protected String name; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String name; - - /** - * Instantiates a new Builder from an existing ListCollectionsOptions instance. - * - * @param listCollectionsOptions the instance to initialize the Builder with - */ - private Builder(ListCollectionsOptions listCollectionsOptions) { - this.environmentId = listCollectionsOptions.environmentId; - this.name = listCollectionsOptions.name; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a ListCollectionsOptions. - * - * @return the new ListCollectionsOptions instance - */ - public ListCollectionsOptions build() { - return new ListCollectionsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListCollectionsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the ListCollectionsOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - } - - protected ListCollectionsOptions() {} - - protected ListCollectionsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - name = builder.name; - } - - /** - * New builder. - * - * @return a ListCollectionsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

Find collections with the given name. - * - * @return the name - */ - public String name() { - return name; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionsResponse.java deleted file mode 100644 index fbbabf730a7..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCollectionsResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Response object containing an array of collection details. */ -public class ListCollectionsResponse extends GenericModel { - - protected List collections; - - protected ListCollectionsResponse() {} - - /** - * Gets the collections. - * - *

An array containing information about each collection in the environment. - * - * @return the collections - */ - public List getCollections() { - return collections; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListConfigurationsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListConfigurationsOptions.java deleted file mode 100644 index 63f47a721dc..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListConfigurationsOptions.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listConfigurations options. */ -public class ListConfigurationsOptions extends GenericModel { - - protected String environmentId; - protected String name; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String name; - - /** - * Instantiates a new Builder from an existing ListConfigurationsOptions instance. - * - * @param listConfigurationsOptions the instance to initialize the Builder with - */ - private Builder(ListConfigurationsOptions listConfigurationsOptions) { - this.environmentId = listConfigurationsOptions.environmentId; - this.name = listConfigurationsOptions.name; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a ListConfigurationsOptions. - * - * @return the new ListConfigurationsOptions instance - */ - public ListConfigurationsOptions build() { - return new ListConfigurationsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListConfigurationsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the ListConfigurationsOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - } - - protected ListConfigurationsOptions() {} - - protected ListConfigurationsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - name = builder.name; - } - - /** - * New builder. - * - * @return a ListConfigurationsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

Find configurations with the given name. - * - * @return the name - */ - public String name() { - return name; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListConfigurationsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListConfigurationsResponse.java deleted file mode 100644 index 00353bd94f8..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListConfigurationsResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Object containing an array of available configurations. */ -public class ListConfigurationsResponse extends GenericModel { - - protected List configurations; - - protected ListConfigurationsResponse() {} - - /** - * Gets the configurations. - * - *

An array of configurations that are available for the service instance. - * - * @return the configurations - */ - public List getConfigurations() { - return configurations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCredentialsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCredentialsOptions.java deleted file mode 100644 index 538af7ee9ce..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListCredentialsOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listCredentials options. */ -public class ListCredentialsOptions extends GenericModel { - - protected String environmentId; - - /** Builder. */ - public static class Builder { - private String environmentId; - - /** - * Instantiates a new Builder from an existing ListCredentialsOptions instance. - * - * @param listCredentialsOptions the instance to initialize the Builder with - */ - private Builder(ListCredentialsOptions listCredentialsOptions) { - this.environmentId = listCredentialsOptions.environmentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a ListCredentialsOptions. - * - * @return the new ListCredentialsOptions instance - */ - public ListCredentialsOptions build() { - return new ListCredentialsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListCredentialsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - } - - protected ListCredentialsOptions() {} - - protected ListCredentialsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - } - - /** - * New builder. - * - * @return a ListCredentialsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsOptions.java deleted file mode 100644 index 022ce2d9ec9..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsOptions.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listEnvironments options. */ -public class ListEnvironmentsOptions extends GenericModel { - - protected String name; - - /** Builder. */ - public static class Builder { - private String name; - - /** - * Instantiates a new Builder from an existing ListEnvironmentsOptions instance. - * - * @param listEnvironmentsOptions the instance to initialize the Builder with - */ - private Builder(ListEnvironmentsOptions listEnvironmentsOptions) { - this.name = listEnvironmentsOptions.name; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a ListEnvironmentsOptions. - * - * @return the new ListEnvironmentsOptions instance - */ - public ListEnvironmentsOptions build() { - return new ListEnvironmentsOptions(this); - } - - /** - * Set the name. - * - * @param name the name - * @return the ListEnvironmentsOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - } - - protected ListEnvironmentsOptions() {} - - protected ListEnvironmentsOptions(Builder builder) { - name = builder.name; - } - - /** - * New builder. - * - * @return a ListEnvironmentsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the name. - * - *

Show only the environment with the given name. - * - * @return the name - */ - public String name() { - return name; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsResponse.java deleted file mode 100644 index 4dbe6f21aab..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Response object containing an array of configured environments. */ -public class ListEnvironmentsResponse extends GenericModel { - - protected List environments; - - protected ListEnvironmentsResponse() {} - - /** - * Gets the environments. - * - *

An array of [environments] that are available for the service instance. - * - * @return the environments - */ - public List getEnvironments() { - return environments; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListExpansionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListExpansionsOptions.java deleted file mode 100644 index 7809135af8a..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListExpansionsOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listExpansions options. */ -public class ListExpansionsOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing ListExpansionsOptions instance. - * - * @param listExpansionsOptions the instance to initialize the Builder with - */ - private Builder(ListExpansionsOptions listExpansionsOptions) { - this.environmentId = listExpansionsOptions.environmentId; - this.collectionId = listExpansionsOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a ListExpansionsOptions. - * - * @return the new ListExpansionsOptions instance - */ - public ListExpansionsOptions build() { - return new ListExpansionsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListExpansionsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the ListExpansionsOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected ListExpansionsOptions() {} - - protected ListExpansionsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a ListExpansionsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListFieldsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListFieldsOptions.java deleted file mode 100644 index 22293d9fa50..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListFieldsOptions.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The listFields options. */ -public class ListFieldsOptions extends GenericModel { - - protected String environmentId; - protected List collectionIds; - - /** Builder. */ - public static class Builder { - private String environmentId; - private List collectionIds; - - /** - * Instantiates a new Builder from an existing ListFieldsOptions instance. - * - * @param listFieldsOptions the instance to initialize the Builder with - */ - private Builder(ListFieldsOptions listFieldsOptions) { - this.environmentId = listFieldsOptions.environmentId; - this.collectionIds = listFieldsOptions.collectionIds; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionIds the collectionIds - */ - public Builder(String environmentId, List collectionIds) { - this.environmentId = environmentId; - this.collectionIds = collectionIds; - } - - /** - * Builds a ListFieldsOptions. - * - * @return the new ListFieldsOptions instance - */ - public ListFieldsOptions build() { - return new ListFieldsOptions(this); - } - - /** - * Adds a new element to collectionIds. - * - * @param collectionIds the new element to be added - * @return the ListFieldsOptions builder - */ - public Builder addCollectionIds(String collectionIds) { - com.ibm.cloud.sdk.core.util.Validator.notNull(collectionIds, "collectionIds cannot be null"); - if (this.collectionIds == null) { - this.collectionIds = new ArrayList(); - } - this.collectionIds.add(collectionIds); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListFieldsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionIds. Existing collectionIds will be replaced. - * - * @param collectionIds the collectionIds - * @return the ListFieldsOptions builder - */ - public Builder collectionIds(List collectionIds) { - this.collectionIds = collectionIds; - return this; - } - } - - protected ListFieldsOptions() {} - - protected ListFieldsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.collectionIds, "collectionIds cannot be null"); - environmentId = builder.environmentId; - collectionIds = builder.collectionIds; - } - - /** - * New builder. - * - * @return a ListFieldsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionIds. - * - *

A comma-separated list of collection IDs to be queried against. - * - * @return the collectionIds - */ - public List collectionIds() { - return collectionIds; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListGatewaysOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListGatewaysOptions.java deleted file mode 100644 index e8b6bb6410c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListGatewaysOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listGateways options. */ -public class ListGatewaysOptions extends GenericModel { - - protected String environmentId; - - /** Builder. */ - public static class Builder { - private String environmentId; - - /** - * Instantiates a new Builder from an existing ListGatewaysOptions instance. - * - * @param listGatewaysOptions the instance to initialize the Builder with - */ - private Builder(ListGatewaysOptions listGatewaysOptions) { - this.environmentId = listGatewaysOptions.environmentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a ListGatewaysOptions. - * - * @return the new ListGatewaysOptions instance - */ - public ListGatewaysOptions build() { - return new ListGatewaysOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListGatewaysOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - } - - protected ListGatewaysOptions() {} - - protected ListGatewaysOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - } - - /** - * New builder. - * - * @return a ListGatewaysOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListTrainingDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListTrainingDataOptions.java deleted file mode 100644 index 844df1362d2..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListTrainingDataOptions.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listTrainingData options. */ -public class ListTrainingDataOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - - /** - * Instantiates a new Builder from an existing ListTrainingDataOptions instance. - * - * @param listTrainingDataOptions the instance to initialize the Builder with - */ - private Builder(ListTrainingDataOptions listTrainingDataOptions) { - this.environmentId = listTrainingDataOptions.environmentId; - this.collectionId = listTrainingDataOptions.collectionId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a ListTrainingDataOptions. - * - * @return the new ListTrainingDataOptions instance - */ - public ListTrainingDataOptions build() { - return new ListTrainingDataOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListTrainingDataOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the ListTrainingDataOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - } - - protected ListTrainingDataOptions() {} - - protected ListTrainingDataOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - } - - /** - * New builder. - * - * @return a ListTrainingDataOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListTrainingExamplesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListTrainingExamplesOptions.java deleted file mode 100644 index 0702ed744bb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/ListTrainingExamplesOptions.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listTrainingExamples options. */ -public class ListTrainingExamplesOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - - /** - * Instantiates a new Builder from an existing ListTrainingExamplesOptions instance. - * - * @param listTrainingExamplesOptions the instance to initialize the Builder with - */ - private Builder(ListTrainingExamplesOptions listTrainingExamplesOptions) { - this.environmentId = listTrainingExamplesOptions.environmentId; - this.collectionId = listTrainingExamplesOptions.collectionId; - this.queryId = listTrainingExamplesOptions.queryId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - */ - public Builder(String environmentId, String collectionId, String queryId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - } - - /** - * Builds a ListTrainingExamplesOptions. - * - * @return the new ListTrainingExamplesOptions instance - */ - public ListTrainingExamplesOptions build() { - return new ListTrainingExamplesOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the ListTrainingExamplesOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the ListTrainingExamplesOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the ListTrainingExamplesOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - } - - protected ListTrainingExamplesOptions() {} - - protected ListTrainingExamplesOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - } - - /** - * New builder. - * - * @return a ListTrainingExamplesOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponse.java deleted file mode 100644 index e0492d69b52..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponse.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Object containing results that match the requested **logs** query. */ -public class LogQueryResponse extends GenericModel { - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List results; - - protected LogQueryResponse() {} - - /** - * Gets the matchingResults. - * - *

Number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the results. - * - *

Array of log query response results. - * - * @return the results - */ - public List getResults() { - return results; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResult.java deleted file mode 100644 index 337b6c2e3d1..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResult.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** - * Individual result object for a **logs** query. Each object represents either a query to a - * Discovery collection or an event that is associated with a query. - */ -public class LogQueryResponseResult extends GenericModel { - - /** - * The type of log entry returned. - * - *

**query** indicates that the log represents the results of a call to the single collection - * **query** method. - * - *

**event** indicates that the log represents a call to the **events** API. - */ - public interface DocumentType { - /** query. */ - String QUERY = "query"; - /** event. */ - String EVENT = "event"; - } - - /** - * The type of event that this object respresents. Possible values are - * - *

- `query` the log of a query to a collection - * - *

- `click` the result of a call to the **events** endpoint. - */ - public interface EventType { - /** click. */ - String CLICK = "click"; - /** query. */ - String QUERY = "query"; - } - - /** - * The type of result that this **event** is associated with. Only returned with logs of type - * `event`. - */ - public interface ResultType { - /** document. */ - String DOCUMENT = "document"; - } - - @SerializedName("environment_id") - protected String environmentId; - - @SerializedName("customer_id") - protected String customerId; - - @SerializedName("document_type") - protected String documentType; - - @SerializedName("natural_language_query") - protected String naturalLanguageQuery; - - @SerializedName("document_results") - protected LogQueryResponseResultDocuments documentResults; - - @SerializedName("created_timestamp") - protected Date createdTimestamp; - - @SerializedName("client_timestamp") - protected Date clientTimestamp; - - @SerializedName("query_id") - protected String queryId; - - @SerializedName("session_token") - protected String sessionToken; - - @SerializedName("collection_id") - protected String collectionId; - - @SerializedName("display_rank") - protected Long displayRank; - - @SerializedName("document_id") - protected String documentId; - - @SerializedName("event_type") - protected String eventType; - - @SerializedName("result_type") - protected String resultType; - - protected LogQueryResponseResult() {} - - /** - * Gets the environmentId. - * - *

The environment ID that is associated with this log entry. - * - * @return the environmentId - */ - public String getEnvironmentId() { - return environmentId; - } - - /** - * Gets the customerId. - * - *

The **customer_id** label that was specified in the header of the query or event API call - * that corresponds to this log entry. - * - * @return the customerId - */ - public String getCustomerId() { - return customerId; - } - - /** - * Gets the documentType. - * - *

The type of log entry returned. - * - *

**query** indicates that the log represents the results of a call to the single collection - * **query** method. - * - *

**event** indicates that the log represents a call to the **events** API. - * - * @return the documentType - */ - public String getDocumentType() { - return documentType; - } - - /** - * Gets the naturalLanguageQuery. - * - *

The value of the **natural_language_query** query parameter that was used to create these - * results. Only returned with logs of type **query**. - * - *

**Note:** Other query parameters (such as **filter** or **deduplicate**) might have been - * used with this query, but are not recorded. - * - * @return the naturalLanguageQuery - */ - public String getNaturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the documentResults. - * - *

Object containing result information that was returned by the query used to create this log - * entry. Only returned with logs of type `query`. - * - * @return the documentResults - */ - public LogQueryResponseResultDocuments getDocumentResults() { - return documentResults; - } - - /** - * Gets the createdTimestamp. - * - *

Date that the log result was created. Returned in `YYYY-MM-DDThh:mm:ssZ` format. - * - * @return the createdTimestamp - */ - public Date getCreatedTimestamp() { - return createdTimestamp; - } - - /** - * Gets the clientTimestamp. - * - *

Date specified by the user when recording an event. Returned in `YYYY-MM-DDThh:mm:ssZ` - * format. Only returned with logs of type **event**. - * - * @return the clientTimestamp - */ - public Date getClientTimestamp() { - return clientTimestamp; - } - - /** - * Gets the queryId. - * - *

Identifier that corresponds to the **natural_language_query** string used in the original or - * associated query. All **event** and **query** log entries that have the same original - * **natural_language_query** string also have them same **query_id**. This field can be used to - * recall all **event** and **query** log results that have the same original query (**event** - * logs do not contain the original **natural_language_query** field). - * - * @return the queryId - */ - public String getQueryId() { - return queryId; - } - - /** - * Gets the sessionToken. - * - *

Unique identifier (within a 24-hour period) that identifies a single `query` log and any - * `event` logs that were created for it. - * - *

**Note:** If the exact same query is run at the exact same time on different days, the - * **session_token** for those queries might be identical. However, the **created_timestamp** - * differs. - * - *

**Note:** Session tokens are case sensitive. To avoid matching on session tokens that are - * identical except for case, use the exact match operator (`::`) when you query for a specific - * session token. - * - * @return the sessionToken - */ - public String getSessionToken() { - return sessionToken; - } - - /** - * Gets the collectionId. - * - *

The collection ID of the document associated with this event. Only returned with logs of - * type `event`. - * - * @return the collectionId - */ - public String getCollectionId() { - return collectionId; - } - - /** - * Gets the displayRank. - * - *

The original display rank of the document associated with this event. Only returned with - * logs of type `event`. - * - * @return the displayRank - */ - public Long getDisplayRank() { - return displayRank; - } - - /** - * Gets the documentId. - * - *

The document ID of the document associated with this event. Only returned with logs of type - * `event`. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the eventType. - * - *

The type of event that this object respresents. Possible values are - * - *

- `query` the log of a query to a collection - * - *

- `click` the result of a call to the **events** endpoint. - * - * @return the eventType - */ - public String getEventType() { - return eventType; - } - - /** - * Gets the resultType. - * - *

The type of result that this **event** is associated with. Only returned with logs of type - * `event`. - * - * @return the resultType - */ - public String getResultType() { - return resultType; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocuments.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocuments.java deleted file mode 100644 index bc3c47641e7..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocuments.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** - * Object containing result information that was returned by the query used to create this log - * entry. Only returned with logs of type `query`. - */ -public class LogQueryResponseResultDocuments extends GenericModel { - - protected List results; - protected Long count; - - protected LogQueryResponseResultDocuments() {} - - /** - * Gets the results. - * - *

Array of log query response results. - * - * @return the results - */ - public List getResults() { - return results; - } - - /** - * Gets the count. - * - *

The number of results returned in the query associate with this log. - * - * @return the count - */ - public Long getCount() { - return count; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsResult.java deleted file mode 100644 index d782dece3e9..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsResult.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** - * Each object in the **results** array corresponds to an individual document returned by the - * original query. - */ -public class LogQueryResponseResultDocumentsResult extends GenericModel { - - protected Long position; - - @SerializedName("document_id") - protected String documentId; - - protected Double score; - protected Double confidence; - - @SerializedName("collection_id") - protected String collectionId; - - protected LogQueryResponseResultDocumentsResult() {} - - /** - * Gets the position. - * - *

The result rank of this document. A position of `1` indicates that it was the first returned - * result. - * - * @return the position - */ - public Long getPosition() { - return position; - } - - /** - * Gets the documentId. - * - *

The **document_id** of the document that this result represents. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the score. - * - *

The raw score of this result. A higher score indicates a greater match to the query - * parameters. - * - * @return the score - */ - public Double getScore() { - return score; - } - - /** - * Gets the confidence. - * - *

The confidence score of the result's analysis. A higher score indicating greater confidence. - * - * @return the confidence - */ - public Double getConfidence() { - return confidence; - } - - /** - * Gets the collectionId. - * - *

The **collection_id** of the document represented by this result. - * - * @return the collectionId - */ - public String getCollectionId() { - return collectionId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricAggregation.java deleted file mode 100644 index 568421866c6..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricAggregation.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** An aggregation analyzing log information for queries and events. */ -public class MetricAggregation extends GenericModel { - - protected String interval; - - @SerializedName("event_type") - protected String eventType; - - protected List results; - - protected MetricAggregation() {} - - /** - * Gets the interval. - * - *

The measurement interval for this metric. Metric intervals are always 1 day (`1d`). - * - * @return the interval - */ - public String getInterval() { - return interval; - } - - /** - * Gets the eventType. - * - *

The event type associated with this metric result. This field, when present, will always be - * `click`. - * - * @return the eventType - */ - public String getEventType() { - return eventType; - } - - /** - * Gets the results. - * - *

Array of metric aggregation query results. - * - * @return the results - */ - public List getResults() { - return results; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricAggregationResult.java deleted file mode 100644 index 639cb1b5615..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricAggregationResult.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** Aggregation result data for the requested metric. */ -public class MetricAggregationResult extends GenericModel { - - @SerializedName("key_as_string") - protected Date keyAsString; - - protected Long key; - - @SerializedName("matching_results") - protected Long matchingResults; - - @SerializedName("event_rate") - protected Double eventRate; - - protected MetricAggregationResult() {} - - /** - * Gets the keyAsString. - * - *

Date in string form representing the start of this interval. - * - * @return the keyAsString - */ - public Date getKeyAsString() { - return keyAsString; - } - - /** - * Gets the key. - * - *

Unix epoch time equivalent of the **key_as_string**, that represents the start of this - * interval. - * - * @return the key - */ - public Long getKey() { - return key; - } - - /** - * Gets the matchingResults. - * - *

Number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the eventRate. - * - *

The number of queries with associated events divided by the total number of queries for the - * interval. Only returned with **event_rate** metrics. - * - * @return the eventRate - */ - public Double getEventRate() { - return eventRate; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricResponse.java deleted file mode 100644 index 0d0eb48ec78..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** The response generated from a call to a **metrics** method. */ -public class MetricResponse extends GenericModel { - - protected List aggregations; - - protected MetricResponse() {} - - /** - * Gets the aggregations. - * - *

Array of metric aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregation.java deleted file mode 100644 index 021dcfdce46..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregation.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** An aggregation analyzing log information for queries and events. */ -public class MetricTokenAggregation extends GenericModel { - - @SerializedName("event_type") - protected String eventType; - - protected List results; - - protected MetricTokenAggregation() {} - - /** - * Gets the eventType. - * - *

The event type associated with this metric result. This field, when present, will always be - * `click`. - * - * @return the eventType - */ - public String getEventType() { - return eventType; - } - - /** - * Gets the results. - * - *

Array of results for the metric token aggregation. - * - * @return the results - */ - public List getResults() { - return results; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationResult.java deleted file mode 100644 index 7cba0d068d3..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationResult.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Aggregation result data for the requested metric. */ -public class MetricTokenAggregationResult extends GenericModel { - - protected String key; - - @SerializedName("matching_results") - protected Long matchingResults; - - @SerializedName("event_rate") - protected Double eventRate; - - protected MetricTokenAggregationResult() {} - - /** - * Gets the key. - * - *

The content of the **natural_language_query** parameter used in the query that this result - * represents. - * - * @return the key - */ - public String getKey() { - return key; - } - - /** - * Gets the matchingResults. - * - *

Number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the eventRate. - * - *

The number of queries with associated events divided by the total number of queries - * currently stored (queries and events are stored in the log for 30 days). - * - * @return the eventRate - */ - public Double getEventRate() { - return eventRate; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenResponse.java deleted file mode 100644 index b9423753c93..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/MetricTokenResponse.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** The response generated from a call to a **metrics** method that evaluates tokens. */ -public class MetricTokenResponse extends GenericModel { - - protected List aggregations; - - protected MetricTokenResponse() {} - - /** - * Gets the aggregations. - * - *

Array of metric token aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentConcepts.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentConcepts.java deleted file mode 100644 index 6a76900ed12..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentConcepts.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object specifiying the concepts enrichment and related parameters. */ -public class NluEnrichmentConcepts extends GenericModel { - - protected Long limit; - - /** Builder. */ - public static class Builder { - private Long limit; - - /** - * Instantiates a new Builder from an existing NluEnrichmentConcepts instance. - * - * @param nluEnrichmentConcepts the instance to initialize the Builder with - */ - private Builder(NluEnrichmentConcepts nluEnrichmentConcepts) { - this.limit = nluEnrichmentConcepts.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentConcepts. - * - * @return the new NluEnrichmentConcepts instance - */ - public NluEnrichmentConcepts build() { - return new NluEnrichmentConcepts(this); - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the NluEnrichmentConcepts builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected NluEnrichmentConcepts() {} - - protected NluEnrichmentConcepts(Builder builder) { - limit = builder.limit; - } - - /** - * New builder. - * - * @return a NluEnrichmentConcepts builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the limit. - * - *

The maximum number of concepts enrichments to extact from each instance of the specified - * field. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEmotion.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEmotion.java deleted file mode 100644 index a51642975c4..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEmotion.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** An object specifying the emotion detection enrichment and related parameters. */ -public class NluEnrichmentEmotion extends GenericModel { - - protected Boolean document; - protected List targets; - - /** Builder. */ - public static class Builder { - private Boolean document; - private List targets; - - /** - * Instantiates a new Builder from an existing NluEnrichmentEmotion instance. - * - * @param nluEnrichmentEmotion the instance to initialize the Builder with - */ - private Builder(NluEnrichmentEmotion nluEnrichmentEmotion) { - this.document = nluEnrichmentEmotion.document; - this.targets = nluEnrichmentEmotion.targets; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentEmotion. - * - * @return the new NluEnrichmentEmotion instance - */ - public NluEnrichmentEmotion build() { - return new NluEnrichmentEmotion(this); - } - - /** - * Adds a new element to targets. - * - * @param target the new element to be added - * @return the NluEnrichmentEmotion builder - */ - public Builder addTarget(String target) { - com.ibm.cloud.sdk.core.util.Validator.notNull(target, "target cannot be null"); - if (this.targets == null) { - this.targets = new ArrayList(); - } - this.targets.add(target); - return this; - } - - /** - * Set the document. - * - * @param document the document - * @return the NluEnrichmentEmotion builder - */ - public Builder document(Boolean document) { - this.document = document; - return this; - } - - /** - * Set the targets. Existing targets will be replaced. - * - * @param targets the targets - * @return the NluEnrichmentEmotion builder - */ - public Builder targets(List targets) { - this.targets = targets; - return this; - } - } - - protected NluEnrichmentEmotion() {} - - protected NluEnrichmentEmotion(Builder builder) { - document = builder.document; - targets = builder.targets; - } - - /** - * New builder. - * - * @return a NluEnrichmentEmotion builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the document. - * - *

When `true`, emotion detection is performed on the entire field. - * - * @return the document - */ - public Boolean document() { - return document; - } - - /** - * Gets the targets. - * - *

A comma-separated list of target strings that will have any associated emotions detected. - * - * @return the targets - */ - public List targets() { - return targets; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEntities.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEntities.java deleted file mode 100644 index 6cdbde468a9..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEntities.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object speficying the Entities enrichment and related parameters. */ -public class NluEnrichmentEntities extends GenericModel { - - protected Boolean sentiment; - protected Boolean emotion; - protected Long limit; - protected Boolean mentions; - - @SerializedName("mention_types") - protected Boolean mentionTypes; - - @SerializedName("sentence_locations") - protected Boolean sentenceLocations; - - protected String model; - - /** Builder. */ - public static class Builder { - private Boolean sentiment; - private Boolean emotion; - private Long limit; - private Boolean mentions; - private Boolean mentionTypes; - private Boolean sentenceLocations; - private String model; - - /** - * Instantiates a new Builder from an existing NluEnrichmentEntities instance. - * - * @param nluEnrichmentEntities the instance to initialize the Builder with - */ - private Builder(NluEnrichmentEntities nluEnrichmentEntities) { - this.sentiment = nluEnrichmentEntities.sentiment; - this.emotion = nluEnrichmentEntities.emotion; - this.limit = nluEnrichmentEntities.limit; - this.mentions = nluEnrichmentEntities.mentions; - this.mentionTypes = nluEnrichmentEntities.mentionTypes; - this.sentenceLocations = nluEnrichmentEntities.sentenceLocations; - this.model = nluEnrichmentEntities.model; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentEntities. - * - * @return the new NluEnrichmentEntities instance - */ - public NluEnrichmentEntities build() { - return new NluEnrichmentEntities(this); - } - - /** - * Set the sentiment. - * - * @param sentiment the sentiment - * @return the NluEnrichmentEntities builder - */ - public Builder sentiment(Boolean sentiment) { - this.sentiment = sentiment; - return this; - } - - /** - * Set the emotion. - * - * @param emotion the emotion - * @return the NluEnrichmentEntities builder - */ - public Builder emotion(Boolean emotion) { - this.emotion = emotion; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the NluEnrichmentEntities builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - - /** - * Set the mentions. - * - * @param mentions the mentions - * @return the NluEnrichmentEntities builder - */ - public Builder mentions(Boolean mentions) { - this.mentions = mentions; - return this; - } - - /** - * Set the mentionTypes. - * - * @param mentionTypes the mentionTypes - * @return the NluEnrichmentEntities builder - */ - public Builder mentionTypes(Boolean mentionTypes) { - this.mentionTypes = mentionTypes; - return this; - } - - /** - * Set the sentenceLocations. - * - * @param sentenceLocations the sentenceLocations - * @return the NluEnrichmentEntities builder - */ - public Builder sentenceLocations(Boolean sentenceLocations) { - this.sentenceLocations = sentenceLocations; - return this; - } - - /** - * Set the model. - * - * @param model the model - * @return the NluEnrichmentEntities builder - */ - public Builder model(String model) { - this.model = model; - return this; - } - } - - protected NluEnrichmentEntities() {} - - protected NluEnrichmentEntities(Builder builder) { - sentiment = builder.sentiment; - emotion = builder.emotion; - limit = builder.limit; - mentions = builder.mentions; - mentionTypes = builder.mentionTypes; - sentenceLocations = builder.sentenceLocations; - model = builder.model; - } - - /** - * New builder. - * - * @return a NluEnrichmentEntities builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the sentiment. - * - *

When `true`, sentiment analysis of entities will be performed on the specified field. - * - * @return the sentiment - */ - public Boolean sentiment() { - return sentiment; - } - - /** - * Gets the emotion. - * - *

When `true`, emotion detection of entities will be performed on the specified field. - * - * @return the emotion - */ - public Boolean emotion() { - return emotion; - } - - /** - * Gets the limit. - * - *

The maximum number of entities to extract for each instance of the specified field. - * - * @return the limit - */ - public Long limit() { - return limit; - } - - /** - * Gets the mentions. - * - *

When `true`, the number of mentions of each identified entity is recorded. The default is - * `false`. - * - * @return the mentions - */ - public Boolean mentions() { - return mentions; - } - - /** - * Gets the mentionTypes. - * - *

When `true`, the types of mentions for each idetifieid entity is recorded. The default is - * `false`. - * - * @return the mentionTypes - */ - public Boolean mentionTypes() { - return mentionTypes; - } - - /** - * Gets the sentenceLocations. - * - *

When `true`, a list of sentence locations for each instance of each identified entity is - * recorded. The default is `false`. - * - * @return the sentenceLocations - */ - public Boolean sentenceLocations() { - return sentenceLocations; - } - - /** - * Gets the model. - * - *

The enrichement model to use with entity extraction. May be a custom model provided by - * Watson Knowledge Studio, or the default public model `alchemy`. - * - * @return the model - */ - public String model() { - return model; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentFeatures.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentFeatures.java deleted file mode 100644 index 297886ad061..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentFeatures.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Map; - -/** Object containing Natural Language Understanding features to be used. */ -public class NluEnrichmentFeatures extends GenericModel { - - protected NluEnrichmentKeywords keywords; - protected NluEnrichmentEntities entities; - protected NluEnrichmentSentiment sentiment; - protected NluEnrichmentEmotion emotion; - protected Map categories; - - @SerializedName("semantic_roles") - protected NluEnrichmentSemanticRoles semanticRoles; - - protected NluEnrichmentRelations relations; - protected NluEnrichmentConcepts concepts; - - /** Builder. */ - public static class Builder { - private NluEnrichmentKeywords keywords; - private NluEnrichmentEntities entities; - private NluEnrichmentSentiment sentiment; - private NluEnrichmentEmotion emotion; - private Map categories; - private NluEnrichmentSemanticRoles semanticRoles; - private NluEnrichmentRelations relations; - private NluEnrichmentConcepts concepts; - - /** - * Instantiates a new Builder from an existing NluEnrichmentFeatures instance. - * - * @param nluEnrichmentFeatures the instance to initialize the Builder with - */ - private Builder(NluEnrichmentFeatures nluEnrichmentFeatures) { - this.keywords = nluEnrichmentFeatures.keywords; - this.entities = nluEnrichmentFeatures.entities; - this.sentiment = nluEnrichmentFeatures.sentiment; - this.emotion = nluEnrichmentFeatures.emotion; - this.categories = nluEnrichmentFeatures.categories; - this.semanticRoles = nluEnrichmentFeatures.semanticRoles; - this.relations = nluEnrichmentFeatures.relations; - this.concepts = nluEnrichmentFeatures.concepts; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentFeatures. - * - * @return the new NluEnrichmentFeatures instance - */ - public NluEnrichmentFeatures build() { - return new NluEnrichmentFeatures(this); - } - - /** - * Set the keywords. - * - * @param keywords the keywords - * @return the NluEnrichmentFeatures builder - */ - public Builder keywords(NluEnrichmentKeywords keywords) { - this.keywords = keywords; - return this; - } - - /** - * Set the entities. - * - * @param entities the entities - * @return the NluEnrichmentFeatures builder - */ - public Builder entities(NluEnrichmentEntities entities) { - this.entities = entities; - return this; - } - - /** - * Set the sentiment. - * - * @param sentiment the sentiment - * @return the NluEnrichmentFeatures builder - */ - public Builder sentiment(NluEnrichmentSentiment sentiment) { - this.sentiment = sentiment; - return this; - } - - /** - * Set the emotion. - * - * @param emotion the emotion - * @return the NluEnrichmentFeatures builder - */ - public Builder emotion(NluEnrichmentEmotion emotion) { - this.emotion = emotion; - return this; - } - - /** - * Set the categories. - * - * @param categories the categories - * @return the NluEnrichmentFeatures builder - */ - public Builder categories(Map categories) { - this.categories = categories; - return this; - } - - /** - * Set the semanticRoles. - * - * @param semanticRoles the semanticRoles - * @return the NluEnrichmentFeatures builder - */ - public Builder semanticRoles(NluEnrichmentSemanticRoles semanticRoles) { - this.semanticRoles = semanticRoles; - return this; - } - - /** - * Set the relations. - * - * @param relations the relations - * @return the NluEnrichmentFeatures builder - */ - public Builder relations(NluEnrichmentRelations relations) { - this.relations = relations; - return this; - } - - /** - * Set the concepts. - * - * @param concepts the concepts - * @return the NluEnrichmentFeatures builder - */ - public Builder concepts(NluEnrichmentConcepts concepts) { - this.concepts = concepts; - return this; - } - } - - protected NluEnrichmentFeatures() {} - - protected NluEnrichmentFeatures(Builder builder) { - keywords = builder.keywords; - entities = builder.entities; - sentiment = builder.sentiment; - emotion = builder.emotion; - categories = builder.categories; - semanticRoles = builder.semanticRoles; - relations = builder.relations; - concepts = builder.concepts; - } - - /** - * New builder. - * - * @return a NluEnrichmentFeatures builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the keywords. - * - *

An object specifying the Keyword enrichment and related parameters. - * - * @return the keywords - */ - public NluEnrichmentKeywords keywords() { - return keywords; - } - - /** - * Gets the entities. - * - *

An object speficying the Entities enrichment and related parameters. - * - * @return the entities - */ - public NluEnrichmentEntities entities() { - return entities; - } - - /** - * Gets the sentiment. - * - *

An object specifying the sentiment extraction enrichment and related parameters. - * - * @return the sentiment - */ - public NluEnrichmentSentiment sentiment() { - return sentiment; - } - - /** - * Gets the emotion. - * - *

An object specifying the emotion detection enrichment and related parameters. - * - * @return the emotion - */ - public NluEnrichmentEmotion emotion() { - return emotion; - } - - /** - * Gets the categories. - * - *

An object that indicates the Categories enrichment will be applied to the specified field. - * - * @return the categories - */ - public Map categories() { - return categories; - } - - /** - * Gets the semanticRoles. - * - *

An object specifiying the semantic roles enrichment and related parameters. - * - * @return the semanticRoles - */ - public NluEnrichmentSemanticRoles semanticRoles() { - return semanticRoles; - } - - /** - * Gets the relations. - * - *

An object specifying the relations enrichment and related parameters. - * - * @return the relations - */ - public NluEnrichmentRelations relations() { - return relations; - } - - /** - * Gets the concepts. - * - *

An object specifiying the concepts enrichment and related parameters. - * - * @return the concepts - */ - public NluEnrichmentConcepts concepts() { - return concepts; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentKeywords.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentKeywords.java deleted file mode 100644 index 4eea6c35691..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentKeywords.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object specifying the Keyword enrichment and related parameters. */ -public class NluEnrichmentKeywords extends GenericModel { - - protected Boolean sentiment; - protected Boolean emotion; - protected Long limit; - - /** Builder. */ - public static class Builder { - private Boolean sentiment; - private Boolean emotion; - private Long limit; - - /** - * Instantiates a new Builder from an existing NluEnrichmentKeywords instance. - * - * @param nluEnrichmentKeywords the instance to initialize the Builder with - */ - private Builder(NluEnrichmentKeywords nluEnrichmentKeywords) { - this.sentiment = nluEnrichmentKeywords.sentiment; - this.emotion = nluEnrichmentKeywords.emotion; - this.limit = nluEnrichmentKeywords.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentKeywords. - * - * @return the new NluEnrichmentKeywords instance - */ - public NluEnrichmentKeywords build() { - return new NluEnrichmentKeywords(this); - } - - /** - * Set the sentiment. - * - * @param sentiment the sentiment - * @return the NluEnrichmentKeywords builder - */ - public Builder sentiment(Boolean sentiment) { - this.sentiment = sentiment; - return this; - } - - /** - * Set the emotion. - * - * @param emotion the emotion - * @return the NluEnrichmentKeywords builder - */ - public Builder emotion(Boolean emotion) { - this.emotion = emotion; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the NluEnrichmentKeywords builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected NluEnrichmentKeywords() {} - - protected NluEnrichmentKeywords(Builder builder) { - sentiment = builder.sentiment; - emotion = builder.emotion; - limit = builder.limit; - } - - /** - * New builder. - * - * @return a NluEnrichmentKeywords builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the sentiment. - * - *

When `true`, sentiment analysis of keywords will be performed on the specified field. - * - * @return the sentiment - */ - public Boolean sentiment() { - return sentiment; - } - - /** - * Gets the emotion. - * - *

When `true`, emotion detection of keywords will be performed on the specified field. - * - * @return the emotion - */ - public Boolean emotion() { - return emotion; - } - - /** - * Gets the limit. - * - *

The maximum number of keywords to extract for each instance of the specified field. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentRelations.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentRelations.java deleted file mode 100644 index 42c9b9aac3d..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentRelations.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object specifying the relations enrichment and related parameters. */ -public class NluEnrichmentRelations extends GenericModel { - - protected String model; - - /** Builder. */ - public static class Builder { - private String model; - - /** - * Instantiates a new Builder from an existing NluEnrichmentRelations instance. - * - * @param nluEnrichmentRelations the instance to initialize the Builder with - */ - private Builder(NluEnrichmentRelations nluEnrichmentRelations) { - this.model = nluEnrichmentRelations.model; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentRelations. - * - * @return the new NluEnrichmentRelations instance - */ - public NluEnrichmentRelations build() { - return new NluEnrichmentRelations(this); - } - - /** - * Set the model. - * - * @param model the model - * @return the NluEnrichmentRelations builder - */ - public Builder model(String model) { - this.model = model; - return this; - } - } - - protected NluEnrichmentRelations() {} - - protected NluEnrichmentRelations(Builder builder) { - model = builder.model; - } - - /** - * New builder. - * - * @return a NluEnrichmentRelations builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the model. - * - *

*For use with `natural_language_understanding` enrichments only.* The enrichement model to - * use with relationship extraction. May be a custom model provided by Watson Knowledge Studio, - * the default public model is`en-news`. - * - * @return the model - */ - public String model() { - return model; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSemanticRoles.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSemanticRoles.java deleted file mode 100644 index 76273e5f668..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSemanticRoles.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object specifiying the semantic roles enrichment and related parameters. */ -public class NluEnrichmentSemanticRoles extends GenericModel { - - protected Boolean entities; - protected Boolean keywords; - protected Long limit; - - /** Builder. */ - public static class Builder { - private Boolean entities; - private Boolean keywords; - private Long limit; - - /** - * Instantiates a new Builder from an existing NluEnrichmentSemanticRoles instance. - * - * @param nluEnrichmentSemanticRoles the instance to initialize the Builder with - */ - private Builder(NluEnrichmentSemanticRoles nluEnrichmentSemanticRoles) { - this.entities = nluEnrichmentSemanticRoles.entities; - this.keywords = nluEnrichmentSemanticRoles.keywords; - this.limit = nluEnrichmentSemanticRoles.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentSemanticRoles. - * - * @return the new NluEnrichmentSemanticRoles instance - */ - public NluEnrichmentSemanticRoles build() { - return new NluEnrichmentSemanticRoles(this); - } - - /** - * Set the entities. - * - * @param entities the entities - * @return the NluEnrichmentSemanticRoles builder - */ - public Builder entities(Boolean entities) { - this.entities = entities; - return this; - } - - /** - * Set the keywords. - * - * @param keywords the keywords - * @return the NluEnrichmentSemanticRoles builder - */ - public Builder keywords(Boolean keywords) { - this.keywords = keywords; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the NluEnrichmentSemanticRoles builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected NluEnrichmentSemanticRoles() {} - - protected NluEnrichmentSemanticRoles(Builder builder) { - entities = builder.entities; - keywords = builder.keywords; - limit = builder.limit; - } - - /** - * New builder. - * - * @return a NluEnrichmentSemanticRoles builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the entities. - * - *

When `true`, entities are extracted from the identified sentence parts. - * - * @return the entities - */ - public Boolean entities() { - return entities; - } - - /** - * Gets the keywords. - * - *

When `true`, keywords are extracted from the identified sentence parts. - * - * @return the keywords - */ - public Boolean keywords() { - return keywords; - } - - /** - * Gets the limit. - * - *

The maximum number of semantic roles enrichments to extact from each instance of the - * specified field. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSentiment.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSentiment.java deleted file mode 100644 index a453c4f34d0..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSentiment.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** An object specifying the sentiment extraction enrichment and related parameters. */ -public class NluEnrichmentSentiment extends GenericModel { - - protected Boolean document; - protected List targets; - - /** Builder. */ - public static class Builder { - private Boolean document; - private List targets; - - /** - * Instantiates a new Builder from an existing NluEnrichmentSentiment instance. - * - * @param nluEnrichmentSentiment the instance to initialize the Builder with - */ - private Builder(NluEnrichmentSentiment nluEnrichmentSentiment) { - this.document = nluEnrichmentSentiment.document; - this.targets = nluEnrichmentSentiment.targets; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NluEnrichmentSentiment. - * - * @return the new NluEnrichmentSentiment instance - */ - public NluEnrichmentSentiment build() { - return new NluEnrichmentSentiment(this); - } - - /** - * Adds a new element to targets. - * - * @param target the new element to be added - * @return the NluEnrichmentSentiment builder - */ - public Builder addTarget(String target) { - com.ibm.cloud.sdk.core.util.Validator.notNull(target, "target cannot be null"); - if (this.targets == null) { - this.targets = new ArrayList(); - } - this.targets.add(target); - return this; - } - - /** - * Set the document. - * - * @param document the document - * @return the NluEnrichmentSentiment builder - */ - public Builder document(Boolean document) { - this.document = document; - return this; - } - - /** - * Set the targets. Existing targets will be replaced. - * - * @param targets the targets - * @return the NluEnrichmentSentiment builder - */ - public Builder targets(List targets) { - this.targets = targets; - return this; - } - } - - protected NluEnrichmentSentiment() {} - - protected NluEnrichmentSentiment(Builder builder) { - document = builder.document; - targets = builder.targets; - } - - /** - * New builder. - * - * @return a NluEnrichmentSentiment builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the document. - * - *

When `true`, sentiment analysis is performed on the entire field. - * - * @return the document - */ - public Boolean document() { - return document; - } - - /** - * Gets the targets. - * - *

A comma-separated list of target strings that will have any associated sentiment analyzed. - * - * @return the targets - */ - public List targets() { - return targets; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NormalizationOperation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NormalizationOperation.java deleted file mode 100644 index e017b510960..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/NormalizationOperation.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing normalization operations. */ -public class NormalizationOperation extends GenericModel { - - /** - * Identifies what type of operation to perform. - * - *

**copy** - Copies the value of the **source_field** to the **destination_field** field. If - * the **destination_field** already exists, then the value of the **source_field** overwrites the - * original value of the **destination_field**. - * - *

**move** - Renames (moves) the **source_field** to the **destination_field**. If the - * **destination_field** already exists, then the value of the **source_field** overwrites the - * original value of the **destination_field**. Rename is identical to copy, except that the - * **source_field** is removed after the value has been copied to the **destination_field** (it is - * the same as a _copy_ followed by a _remove_). - * - *

**merge** - Merges the value of the **source_field** with the value of the - * **destination_field**. The **destination_field** is converted into an array if it is not - * already an array, and the value of the **source_field** is appended to the array. This - * operation removes the **source_field** after the merge. If the **source_field** does not exist - * in the current document, then the **destination_field** is still converted into an array (if it - * is not an array already). This conversion ensures the type for **destination_field** is - * consistent across all documents. - * - *

**remove** - Deletes the **source_field** field. The **destination_field** is ignored for - * this operation. - * - *

**remove_nulls** - Removes all nested null (blank) field values from the ingested document. - * **source_field** and **destination_field** are ignored by this operation because _remove_nulls_ - * operates on the entire ingested document. Typically, **remove_nulls** is invoked as the last - * normalization operation (if it is invoked at all, it can be time-expensive). - */ - public interface Operation { - /** copy. */ - String COPY = "copy"; - /** move. */ - String MOVE = "move"; - /** merge. */ - String MERGE = "merge"; - /** remove. */ - String REMOVE = "remove"; - /** remove_nulls. */ - String REMOVE_NULLS = "remove_nulls"; - } - - protected String operation; - - @SerializedName("source_field") - protected String sourceField; - - @SerializedName("destination_field") - protected String destinationField; - - /** Builder. */ - public static class Builder { - private String operation; - private String sourceField; - private String destinationField; - - /** - * Instantiates a new Builder from an existing NormalizationOperation instance. - * - * @param normalizationOperation the instance to initialize the Builder with - */ - private Builder(NormalizationOperation normalizationOperation) { - this.operation = normalizationOperation.operation; - this.sourceField = normalizationOperation.sourceField; - this.destinationField = normalizationOperation.destinationField; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a NormalizationOperation. - * - * @return the new NormalizationOperation instance - */ - public NormalizationOperation build() { - return new NormalizationOperation(this); - } - - /** - * Set the operation. - * - * @param operation the operation - * @return the NormalizationOperation builder - */ - public Builder operation(String operation) { - this.operation = operation; - return this; - } - - /** - * Set the sourceField. - * - * @param sourceField the sourceField - * @return the NormalizationOperation builder - */ - public Builder sourceField(String sourceField) { - this.sourceField = sourceField; - return this; - } - - /** - * Set the destinationField. - * - * @param destinationField the destinationField - * @return the NormalizationOperation builder - */ - public Builder destinationField(String destinationField) { - this.destinationField = destinationField; - return this; - } - } - - protected NormalizationOperation() {} - - protected NormalizationOperation(Builder builder) { - operation = builder.operation; - sourceField = builder.sourceField; - destinationField = builder.destinationField; - } - - /** - * New builder. - * - * @return a NormalizationOperation builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the operation. - * - *

Identifies what type of operation to perform. - * - *

**copy** - Copies the value of the **source_field** to the **destination_field** field. If - * the **destination_field** already exists, then the value of the **source_field** overwrites the - * original value of the **destination_field**. - * - *

**move** - Renames (moves) the **source_field** to the **destination_field**. If the - * **destination_field** already exists, then the value of the **source_field** overwrites the - * original value of the **destination_field**. Rename is identical to copy, except that the - * **source_field** is removed after the value has been copied to the **destination_field** (it is - * the same as a _copy_ followed by a _remove_). - * - *

**merge** - Merges the value of the **source_field** with the value of the - * **destination_field**. The **destination_field** is converted into an array if it is not - * already an array, and the value of the **source_field** is appended to the array. This - * operation removes the **source_field** after the merge. If the **source_field** does not exist - * in the current document, then the **destination_field** is still converted into an array (if it - * is not an array already). This conversion ensures the type for **destination_field** is - * consistent across all documents. - * - *

**remove** - Deletes the **source_field** field. The **destination_field** is ignored for - * this operation. - * - *

**remove_nulls** - Removes all nested null (blank) field values from the ingested document. - * **source_field** and **destination_field** are ignored by this operation because _remove_nulls_ - * operates on the entire ingested document. Typically, **remove_nulls** is invoked as the last - * normalization operation (if it is invoked at all, it can be time-expensive). - * - * @return the operation - */ - public String operation() { - return operation; - } - - /** - * Gets the sourceField. - * - *

The source field for the operation. - * - * @return the sourceField - */ - public String sourceField() { - return sourceField; - } - - /** - * Gets the destinationField. - * - *

The destination field for the operation. - * - * @return the destinationField - */ - public String destinationField() { - return destinationField; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Notice.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Notice.java deleted file mode 100644 index 149e2d42fde..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Notice.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** A notice produced for the collection. */ -public class Notice extends GenericModel { - - /** Severity level of the notice. */ - public interface Severity { - /** warning. */ - String WARNING = "warning"; - /** error. */ - String ERROR = "error"; - } - - @SerializedName("notice_id") - protected String noticeId; - - protected Date created; - - @SerializedName("document_id") - protected String documentId; - - @SerializedName("query_id") - protected String queryId; - - protected String severity; - protected String step; - protected String description; - - protected Notice() {} - - /** - * Gets the noticeId. - * - *

Identifies the notice. Many notices might have the same ID. This field exists so that user - * applications can programmatically identify a notice and take automatic corrective action. - * Typical notice IDs include: `index_failed`, `index_failed_too_many_requests`, - * `index_failed_incompatible_field`, `index_failed_cluster_unavailable`, `ingestion_timeout`, - * `ingestion_error`, `bad_request`, `internal_error`, `missing_model`, `unsupported_model`, - * `smart_document_understanding_failed_incompatible_field`, - * `smart_document_understanding_failed_internal_error`, - * `smart_document_understanding_failed_internal_error`, - * `smart_document_understanding_failed_warning`, `smart_document_understanding_page_error`, - * `smart_document_understanding_page_warning`. **Note:** This is not a complete list; other - * values might be returned. - * - * @return the noticeId - */ - public String getNoticeId() { - return noticeId; - } - - /** - * Gets the created. - * - *

The creation date of the collection in the format yyyy-MM-dd'T'HH:mm:ss.SSS'Z'. - * - * @return the created - */ - public Date getCreated() { - return created; - } - - /** - * Gets the documentId. - * - *

Unique identifier of the document. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the queryId. - * - *

Unique identifier of the query used for relevance training. - * - * @return the queryId - */ - public String getQueryId() { - return queryId; - } - - /** - * Gets the severity. - * - *

Severity level of the notice. - * - * @return the severity - */ - public String getSeverity() { - return severity; - } - - /** - * Gets the step. - * - *

Ingestion or training step in which the notice occurred. Typical step values include: - * `smartDocumentUnderstanding`, `ingestion`, `indexing`, `convert`. **Note:** This is not a - * complete list; other values might be returned. - * - * @return the step - */ - public String getStep() { - return step; - } - - /** - * Gets the description. - * - *

The description of the notice. - * - * @return the description - */ - public String getDescription() { - return description; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/PdfHeadingDetection.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/PdfHeadingDetection.java deleted file mode 100644 index 5719d4d4d91..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/PdfHeadingDetection.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** Object containing heading detection conversion settings for PDF documents. */ -public class PdfHeadingDetection extends GenericModel { - - protected List fonts; - - /** Builder. */ - public static class Builder { - private List fonts; - - /** - * Instantiates a new Builder from an existing PdfHeadingDetection instance. - * - * @param pdfHeadingDetection the instance to initialize the Builder with - */ - private Builder(PdfHeadingDetection pdfHeadingDetection) { - this.fonts = pdfHeadingDetection.fonts; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a PdfHeadingDetection. - * - * @return the new PdfHeadingDetection instance - */ - public PdfHeadingDetection build() { - return new PdfHeadingDetection(this); - } - - /** - * Adds a new element to fonts. - * - * @param fontSetting the new element to be added - * @return the PdfHeadingDetection builder - */ - public Builder addFontSetting(FontSetting fontSetting) { - com.ibm.cloud.sdk.core.util.Validator.notNull(fontSetting, "fontSetting cannot be null"); - if (this.fonts == null) { - this.fonts = new ArrayList(); - } - this.fonts.add(fontSetting); - return this; - } - - /** - * Set the fonts. Existing fonts will be replaced. - * - * @param fonts the fonts - * @return the PdfHeadingDetection builder - */ - public Builder fonts(List fonts) { - this.fonts = fonts; - return this; - } - } - - protected PdfHeadingDetection() {} - - protected PdfHeadingDetection(Builder builder) { - fonts = builder.fonts; - } - - /** - * New builder. - * - * @return a PdfHeadingDetection builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the fonts. - * - *

Array of font matching configurations. - * - * @return the fonts - */ - public List fonts() { - return fonts; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/PdfSettings.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/PdfSettings.java deleted file mode 100644 index 16e3f0d5ebb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/PdfSettings.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** A list of PDF conversion settings. */ -public class PdfSettings extends GenericModel { - - protected PdfHeadingDetection heading; - - /** Builder. */ - public static class Builder { - private PdfHeadingDetection heading; - - /** - * Instantiates a new Builder from an existing PdfSettings instance. - * - * @param pdfSettings the instance to initialize the Builder with - */ - private Builder(PdfSettings pdfSettings) { - this.heading = pdfSettings.heading; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a PdfSettings. - * - * @return the new PdfSettings instance - */ - public PdfSettings build() { - return new PdfSettings(this); - } - - /** - * Set the heading. - * - * @param heading the heading - * @return the PdfSettings builder - */ - public Builder heading(PdfHeadingDetection heading) { - this.heading = heading; - return this; - } - } - - protected PdfSettings() {} - - protected PdfSettings(Builder builder) { - heading = builder.heading; - } - - /** - * New builder. - * - * @return a PdfSettings builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the heading. - * - *

Object containing heading detection conversion settings for PDF documents. - * - * @return the heading - */ - public PdfHeadingDetection heading() { - return heading; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryAggregation.java deleted file mode 100644 index 798399c5334..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryAggregation.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An aggregation produced by Discovery to analyze the input provided. */ -public class QueryAggregation extends GenericModel { - @SuppressWarnings("unused") - protected static String discriminatorPropertyName = "type"; - - protected static java.util.Map> discriminatorMapping; - - static { - discriminatorMapping = new java.util.HashMap<>(); - discriminatorMapping.put("histogram", QueryHistogramAggregation.class); - discriminatorMapping.put("max", QueryCalculationAggregation.class); - discriminatorMapping.put("min", QueryCalculationAggregation.class); - discriminatorMapping.put("average", QueryCalculationAggregation.class); - discriminatorMapping.put("sum", QueryCalculationAggregation.class); - discriminatorMapping.put("unique_count", QueryCalculationAggregation.class); - discriminatorMapping.put("term", QueryTermAggregation.class); - discriminatorMapping.put("filter", QueryFilterAggregation.class); - discriminatorMapping.put("nested", QueryNestedAggregation.class); - discriminatorMapping.put("timeslice", QueryTimesliceAggregation.class); - discriminatorMapping.put("top_hits", QueryTopHitsAggregation.class); - } - - protected String type; - - protected QueryAggregation() {} - - /** - * Gets the type. - * - *

The type of aggregation command used. For example: term, filter, max, min, etc. - * - * @return the type - */ - public String getType() { - return type; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryCalculationAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryCalculationAggregation.java deleted file mode 100644 index ed529094620..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryCalculationAggregation.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -/** - * Returns a scalar calculation across all documents for the field specified. Possible calculations - * include min, max, sum, average, and unique_count. - */ -public class QueryCalculationAggregation extends QueryAggregation { - - protected String field; - protected Double value; - - protected QueryCalculationAggregation() {} - - /** - * Gets the field. - * - *

The field to perform the calculation on. - * - * @return the field - */ - public String getField() { - return field; - } - - /** - * Gets the value. - * - *

The value of the calculation. - * - * @return the value - */ - public Double getValue() { - return value; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryFilterAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryFilterAggregation.java deleted file mode 100644 index 3d1c5e45b80..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryFilterAggregation.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import java.util.List; - -/** A modifier that narrows the document set of the sub-aggregations it precedes. */ -public class QueryFilterAggregation extends QueryAggregation { - - protected String match; - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List aggregations; - - protected QueryFilterAggregation() {} - - /** - * Gets the match. - * - *

The filter that is written in Discovery Query Language syntax and is applied to the - * documents before sub-aggregations are run. - * - * @return the match - */ - public String getMatch() { - return match; - } - - /** - * Gets the matchingResults. - * - *

Number of documents that match the filter. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the aggregations. - * - *

An array of sub-aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregation.java deleted file mode 100644 index 2b7aedb6f40..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregation.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import java.util.List; - -/** - * Numeric interval segments to categorize documents by using field values from a single numeric - * field to describe the category. - */ -public class QueryHistogramAggregation extends QueryAggregation { - - protected String field; - protected Long interval; - protected String name; - protected List results; - - protected QueryHistogramAggregation() {} - - /** - * Gets the field. - * - *

The numeric field name used to create the histogram. - * - * @return the field - */ - public String getField() { - return field; - } - - /** - * Gets the interval. - * - *

The size of the sections that the results are split into. - * - * @return the interval - */ - public Long getInterval() { - return interval; - } - - /** - * Gets the name. - * - *

Identifier specified in the query request of this aggregation. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the results. - * - *

Array of numeric intervals. - * - * @return the results - */ - public List getResults() { - return results; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationResult.java deleted file mode 100644 index 8c0162e93d8..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationResult.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Histogram numeric interval result. */ -public class QueryHistogramAggregationResult extends GenericModel { - - protected Long key; - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List aggregations; - - protected QueryHistogramAggregationResult() {} - - /** - * Gets the key. - * - *

The value of the upper bound for the numeric segment. - * - * @return the key - */ - public Long getKey() { - return key; - } - - /** - * Gets the matchingResults. - * - *

Number of documents with the specified key as the upper bound. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the aggregations. - * - *

An array of sub-aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryLogOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryLogOptions.java deleted file mode 100644 index 7bef1b17fa2..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryLogOptions.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The queryLog options. */ -public class QueryLogOptions extends GenericModel { - - protected String filter; - protected String query; - protected Long count; - protected Long offset; - protected List sort; - - /** Builder. */ - public static class Builder { - private String filter; - private String query; - private Long count; - private Long offset; - private List sort; - - /** - * Instantiates a new Builder from an existing QueryLogOptions instance. - * - * @param queryLogOptions the instance to initialize the Builder with - */ - private Builder(QueryLogOptions queryLogOptions) { - this.filter = queryLogOptions.filter; - this.query = queryLogOptions.query; - this.count = queryLogOptions.count; - this.offset = queryLogOptions.offset; - this.sort = queryLogOptions.sort; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a QueryLogOptions. - * - * @return the new QueryLogOptions instance - */ - public QueryLogOptions build() { - return new QueryLogOptions(this); - } - - /** - * Adds a new element to sort. - * - * @param sort the new element to be added - * @return the QueryLogOptions builder - */ - public Builder addSort(String sort) { - com.ibm.cloud.sdk.core.util.Validator.notNull(sort, "sort cannot be null"); - if (this.sort == null) { - this.sort = new ArrayList(); - } - this.sort.add(sort); - return this; - } - - /** - * Set the filter. - * - * @param filter the filter - * @return the QueryLogOptions builder - */ - public Builder filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set the query. - * - * @param query the query - * @return the QueryLogOptions builder - */ - public Builder query(String query) { - this.query = query; - return this; - } - - /** - * Set the count. - * - * @param count the count - * @return the QueryLogOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the QueryLogOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - - /** - * Set the sort. Existing sort will be replaced. - * - * @param sort the sort - * @return the QueryLogOptions builder - */ - public Builder sort(List sort) { - this.sort = sort; - return this; - } - } - - protected QueryLogOptions() {} - - protected QueryLogOptions(Builder builder) { - filter = builder.filter; - query = builder.query; - count = builder.count; - offset = builder.offset; - sort = builder.sort; - } - - /** - * New builder. - * - * @return a QueryLogOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the filter. - * - *

A cacheable query that excludes documents that don't mention the query content. Filter - * searches are better for metadata-type searches and for assessing the concepts in the data set. - * - * @return the filter - */ - public String filter() { - return filter; - } - - /** - * Gets the query. - * - *

A query search returns all documents in your data set with full enrichments and full text, - * but with the most relevant documents listed first. - * - * @return the query - */ - public String query() { - return query; - } - - /** - * Gets the count. - * - *

Number of results to return. The maximum for the **count** and **offset** values together in - * any one query is **10000**. - * - * @return the count - */ - public Long count() { - return count; - } - - /** - * Gets the offset. - * - *

The number of query results to skip at the beginning. For example, if the total number of - * results that are returned is 10 and the offset is 8, it returns the last two results. The - * maximum for the **count** and **offset** values together in any one query is **10000**. - * - * @return the offset - */ - public Long offset() { - return offset; - } - - /** - * Gets the sort. - * - *

A comma-separated list of fields in the document to sort on. You can optionally specify a - * sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending - * is the default sort direction if no prefix is specified. - * - * @return the sort - */ - public List sort() { - return sort; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNestedAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNestedAggregation.java deleted file mode 100644 index 4afd77ab57e..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNestedAggregation.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import java.util.List; - -/** - * A restriction that alters the document set that is used for sub-aggregations it precedes to - * nested documents found in the field specified. - */ -public class QueryNestedAggregation extends QueryAggregation { - - protected String path; - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List aggregations; - - protected QueryNestedAggregation() {} - - /** - * Gets the path. - * - *

The path to the document field to scope sub-aggregations to. - * - * @return the path - */ - public String getPath() { - return path; - } - - /** - * Gets the matchingResults. - * - *

Number of nested documents found in the specified field. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the aggregations. - * - *

An array of sub-aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesOptions.java deleted file mode 100644 index a7a0d907d98..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesOptions.java +++ /dev/null @@ -1,667 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The queryNotices options. */ -public class QueryNoticesOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String filter; - protected String query; - protected String naturalLanguageQuery; - protected Boolean passages; - protected String aggregation; - protected Long count; - protected List xReturn; - protected Long offset; - protected List sort; - protected Boolean highlight; - protected List passagesFields; - protected Long passagesCount; - protected Long passagesCharacters; - protected String deduplicateField; - protected Boolean similar; - protected List similarDocumentIds; - protected List similarFields; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String filter; - private String query; - private String naturalLanguageQuery; - private Boolean passages; - private String aggregation; - private Long count; - private List xReturn; - private Long offset; - private List sort; - private Boolean highlight; - private List passagesFields; - private Long passagesCount; - private Long passagesCharacters; - private String deduplicateField; - private Boolean similar; - private List similarDocumentIds; - private List similarFields; - - /** - * Instantiates a new Builder from an existing QueryNoticesOptions instance. - * - * @param queryNoticesOptions the instance to initialize the Builder with - */ - private Builder(QueryNoticesOptions queryNoticesOptions) { - this.environmentId = queryNoticesOptions.environmentId; - this.collectionId = queryNoticesOptions.collectionId; - this.filter = queryNoticesOptions.filter; - this.query = queryNoticesOptions.query; - this.naturalLanguageQuery = queryNoticesOptions.naturalLanguageQuery; - this.passages = queryNoticesOptions.passages; - this.aggregation = queryNoticesOptions.aggregation; - this.count = queryNoticesOptions.count; - this.xReturn = queryNoticesOptions.xReturn; - this.offset = queryNoticesOptions.offset; - this.sort = queryNoticesOptions.sort; - this.highlight = queryNoticesOptions.highlight; - this.passagesFields = queryNoticesOptions.passagesFields; - this.passagesCount = queryNoticesOptions.passagesCount; - this.passagesCharacters = queryNoticesOptions.passagesCharacters; - this.deduplicateField = queryNoticesOptions.deduplicateField; - this.similar = queryNoticesOptions.similar; - this.similarDocumentIds = queryNoticesOptions.similarDocumentIds; - this.similarFields = queryNoticesOptions.similarFields; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a QueryNoticesOptions. - * - * @return the new QueryNoticesOptions instance - */ - public QueryNoticesOptions build() { - return new QueryNoticesOptions(this); - } - - /** - * Adds a new element to xReturn. - * - * @param returnField the new element to be added - * @return the QueryNoticesOptions builder - */ - public Builder addReturnField(String returnField) { - com.ibm.cloud.sdk.core.util.Validator.notNull(returnField, "returnField cannot be null"); - if (this.xReturn == null) { - this.xReturn = new ArrayList(); - } - this.xReturn.add(returnField); - return this; - } - - /** - * Adds a new element to sort. - * - * @param sort the new element to be added - * @return the QueryNoticesOptions builder - */ - public Builder addSort(String sort) { - com.ibm.cloud.sdk.core.util.Validator.notNull(sort, "sort cannot be null"); - if (this.sort == null) { - this.sort = new ArrayList(); - } - this.sort.add(sort); - return this; - } - - /** - * Adds a new element to passagesFields. - * - * @param passagesFields the new element to be added - * @return the QueryNoticesOptions builder - */ - public Builder addPassagesFields(String passagesFields) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - passagesFields, "passagesFields cannot be null"); - if (this.passagesFields == null) { - this.passagesFields = new ArrayList(); - } - this.passagesFields.add(passagesFields); - return this; - } - - /** - * Adds a new element to similarDocumentIds. - * - * @param similarDocumentIds the new element to be added - * @return the QueryNoticesOptions builder - */ - public Builder addSimilarDocumentIds(String similarDocumentIds) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - similarDocumentIds, "similarDocumentIds cannot be null"); - if (this.similarDocumentIds == null) { - this.similarDocumentIds = new ArrayList(); - } - this.similarDocumentIds.add(similarDocumentIds); - return this; - } - - /** - * Adds a new element to similarFields. - * - * @param similarFields the new element to be added - * @return the QueryNoticesOptions builder - */ - public Builder addSimilarFields(String similarFields) { - com.ibm.cloud.sdk.core.util.Validator.notNull(similarFields, "similarFields cannot be null"); - if (this.similarFields == null) { - this.similarFields = new ArrayList(); - } - this.similarFields.add(similarFields); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the QueryNoticesOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the QueryNoticesOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the filter. - * - * @param filter the filter - * @return the QueryNoticesOptions builder - */ - public Builder filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set the query. - * - * @param query the query - * @return the QueryNoticesOptions builder - */ - public Builder query(String query) { - this.query = query; - return this; - } - - /** - * Set the naturalLanguageQuery. - * - * @param naturalLanguageQuery the naturalLanguageQuery - * @return the QueryNoticesOptions builder - */ - public Builder naturalLanguageQuery(String naturalLanguageQuery) { - this.naturalLanguageQuery = naturalLanguageQuery; - return this; - } - - /** - * Set the passages. - * - * @param passages the passages - * @return the QueryNoticesOptions builder - */ - public Builder passages(Boolean passages) { - this.passages = passages; - return this; - } - - /** - * Set the aggregation. - * - * @param aggregation the aggregation - * @return the QueryNoticesOptions builder - */ - public Builder aggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Set the count. - * - * @param count the count - * @return the QueryNoticesOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - - /** - * Set the xReturn. Existing xReturn will be replaced. - * - * @param xReturn the xReturn - * @return the QueryNoticesOptions builder - */ - public Builder xReturn(List xReturn) { - this.xReturn = xReturn; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the QueryNoticesOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - - /** - * Set the sort. Existing sort will be replaced. - * - * @param sort the sort - * @return the QueryNoticesOptions builder - */ - public Builder sort(List sort) { - this.sort = sort; - return this; - } - - /** - * Set the highlight. - * - * @param highlight the highlight - * @return the QueryNoticesOptions builder - */ - public Builder highlight(Boolean highlight) { - this.highlight = highlight; - return this; - } - - /** - * Set the passagesFields. Existing passagesFields will be replaced. - * - * @param passagesFields the passagesFields - * @return the QueryNoticesOptions builder - */ - public Builder passagesFields(List passagesFields) { - this.passagesFields = passagesFields; - return this; - } - - /** - * Set the passagesCount. - * - * @param passagesCount the passagesCount - * @return the QueryNoticesOptions builder - */ - public Builder passagesCount(long passagesCount) { - this.passagesCount = passagesCount; - return this; - } - - /** - * Set the passagesCharacters. - * - * @param passagesCharacters the passagesCharacters - * @return the QueryNoticesOptions builder - */ - public Builder passagesCharacters(long passagesCharacters) { - this.passagesCharacters = passagesCharacters; - return this; - } - - /** - * Set the deduplicateField. - * - * @param deduplicateField the deduplicateField - * @return the QueryNoticesOptions builder - */ - public Builder deduplicateField(String deduplicateField) { - this.deduplicateField = deduplicateField; - return this; - } - - /** - * Set the similar. - * - * @param similar the similar - * @return the QueryNoticesOptions builder - */ - public Builder similar(Boolean similar) { - this.similar = similar; - return this; - } - - /** - * Set the similarDocumentIds. Existing similarDocumentIds will be replaced. - * - * @param similarDocumentIds the similarDocumentIds - * @return the QueryNoticesOptions builder - */ - public Builder similarDocumentIds(List similarDocumentIds) { - this.similarDocumentIds = similarDocumentIds; - return this; - } - - /** - * Set the similarFields. Existing similarFields will be replaced. - * - * @param similarFields the similarFields - * @return the QueryNoticesOptions builder - */ - public Builder similarFields(List similarFields) { - this.similarFields = similarFields; - return this; - } - } - - protected QueryNoticesOptions() {} - - protected QueryNoticesOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - filter = builder.filter; - query = builder.query; - naturalLanguageQuery = builder.naturalLanguageQuery; - passages = builder.passages; - aggregation = builder.aggregation; - count = builder.count; - xReturn = builder.xReturn; - offset = builder.offset; - sort = builder.sort; - highlight = builder.highlight; - passagesFields = builder.passagesFields; - passagesCount = builder.passagesCount; - passagesCharacters = builder.passagesCharacters; - deduplicateField = builder.deduplicateField; - similar = builder.similar; - similarDocumentIds = builder.similarDocumentIds; - similarFields = builder.similarFields; - } - - /** - * New builder. - * - * @return a QueryNoticesOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the filter. - * - *

A cacheable query that excludes documents that don't mention the query content. Filter - * searches are better for metadata-type searches and for assessing the concepts in the data set. - * - * @return the filter - */ - public String filter() { - return filter; - } - - /** - * Gets the query. - * - *

A query search returns all documents in your data set with full enrichments and full text, - * but with the most relevant documents listed first. - * - * @return the query - */ - public String query() { - return query; - } - - /** - * Gets the naturalLanguageQuery. - * - *

A natural language query that returns relevant documents by utilizing training data and - * natural language understanding. - * - * @return the naturalLanguageQuery - */ - public String naturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the passages. - * - *

A passages query that returns the most relevant passages from the results. - * - * @return the passages - */ - public Boolean passages() { - return passages; - } - - /** - * Gets the aggregation. - * - *

An aggregation search that returns an exact answer by combining query search with filters. - * Useful for applications to build lists, tables, and time series. For a full list of possible - * aggregations, see the Query reference. - * - * @return the aggregation - */ - public String aggregation() { - return aggregation; - } - - /** - * Gets the count. - * - *

Number of results to return. The maximum for the **count** and **offset** values together in - * any one query is **10000**. - * - * @return the count - */ - public Long count() { - return count; - } - - /** - * Gets the xReturn. - * - *

A comma-separated list of the portion of the document hierarchy to return. - * - * @return the xReturn - */ - public List xReturn() { - return xReturn; - } - - /** - * Gets the offset. - * - *

The number of query results to skip at the beginning. For example, if the total number of - * results that are returned is 10 and the offset is 8, it returns the last two results. The - * maximum for the **count** and **offset** values together in any one query is **10000**. - * - * @return the offset - */ - public Long offset() { - return offset; - } - - /** - * Gets the sort. - * - *

A comma-separated list of fields in the document to sort on. You can optionally specify a - * sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending - * is the default sort direction if no prefix is specified. - * - * @return the sort - */ - public List sort() { - return sort; - } - - /** - * Gets the highlight. - * - *

When true, a highlight field is returned for each result which contains the fields which - * match the query with `<em></em>` tags around the matching query terms. - * - * @return the highlight - */ - public Boolean highlight() { - return highlight; - } - - /** - * Gets the passagesFields. - * - *

A comma-separated list of fields that passages are drawn from. If this parameter not - * specified, then all top-level fields are included. - * - * @return the passagesFields - */ - public List passagesFields() { - return passagesFields; - } - - /** - * Gets the passagesCount. - * - *

The maximum number of passages to return. The search returns fewer passages if the requested - * total is not found. - * - * @return the passagesCount - */ - public Long passagesCount() { - return passagesCount; - } - - /** - * Gets the passagesCharacters. - * - *

The approximate number of characters that any one passage will have. - * - * @return the passagesCharacters - */ - public Long passagesCharacters() { - return passagesCharacters; - } - - /** - * Gets the deduplicateField. - * - *

When specified, duplicate results based on the field specified are removed from the returned - * results. Duplicate comparison is limited to the current query only, **offset** is not - * considered. This parameter is currently Beta functionality. - * - * @return the deduplicateField - */ - public String deduplicateField() { - return deduplicateField; - } - - /** - * Gets the similar. - * - *

When `true`, results are returned based on their similarity to the document IDs specified in - * the **similar.document_ids** parameter. - * - * @return the similar - */ - public Boolean similar() { - return similar; - } - - /** - * Gets the similarDocumentIds. - * - *

A comma-separated list of document IDs to find similar documents. - * - *

**Tip:** Include the **natural_language_query** parameter to expand the scope of the - * document similarity search with the natural language query. Other query parameters, such as - * **filter** and **query**, are subsequently applied and reduce the scope. - * - * @return the similarDocumentIds - */ - public List similarDocumentIds() { - return similarDocumentIds; - } - - /** - * Gets the similarFields. - * - *

A comma-separated list of field names that are used as a basis for comparison to identify - * similar documents. If not specified, the entire document is used for comparison. - * - * @return the similarFields - */ - public List similarFields() { - return similarFields; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesResponse.java deleted file mode 100644 index 095c085e221..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesResponse.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Object containing notice query results. */ -public class QueryNoticesResponse extends GenericModel { - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List results; - protected List aggregations; - protected List passages; - - @SerializedName("duplicates_removed") - protected Long duplicatesRemoved; - - protected QueryNoticesResponse() {} - - /** - * Gets the matchingResults. - * - *

The number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the results. - * - *

Array of document results that match the query. - * - * @return the results - */ - public List getResults() { - return results; - } - - /** - * Gets the aggregations. - * - *

Array of aggregation results that match the query. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } - - /** - * Gets the passages. - * - *

Array of passage results that match the query. - * - * @return the passages - */ - public List getPassages() { - return passages; - } - - /** - * Gets the duplicatesRemoved. - * - *

The number of duplicates removed from this notices query. - * - * @return the duplicatesRemoved - */ - public Long getDuplicatesRemoved() { - return duplicatesRemoved; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesResult.java deleted file mode 100644 index 9dfb9603eae..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryNoticesResult.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.ibm.cloud.sdk.core.service.model.DynamicModel; -import java.util.List; -import java.util.Map; - -/** Query result object. */ -public class QueryNoticesResult extends DynamicModel { - - /** The type of the original source file. */ - public interface FileType { - /** pdf. */ - String PDF = "pdf"; - /** html. */ - String HTML = "html"; - /** word. */ - String WORD = "word"; - /** json. */ - String JSON = "json"; - } - - @SerializedName("id") - protected String id; - - @SerializedName("metadata") - protected Map metadata; - - @SerializedName("collection_id") - protected String collectionId; - - @SerializedName("result_metadata") - protected QueryResultMetadata resultMetadata; - - @SerializedName("code") - protected Long code; - - @SerializedName("filename") - protected String filename; - - @SerializedName("file_type") - protected String fileType; - - @SerializedName("sha1") - protected String sha1; - - @SerializedName("notices") - protected List notices; - - public QueryNoticesResult() { - super(new TypeToken() {}); - } - - /** - * Gets the id. - * - *

The unique identifier of the document. - * - * @return the id - */ - public String getId() { - return this.id; - } - - /** - * Gets the metadata. - * - *

Metadata of the document. - * - * @return the metadata - */ - public Map getMetadata() { - return this.metadata; - } - - /** - * Gets the collectionId. - * - *

The collection ID of the collection containing the document for this result. - * - * @return the collectionId - */ - public String getCollectionId() { - return this.collectionId; - } - - /** - * Gets the resultMetadata. - * - *

Metadata of a query result. - * - * @return the resultMetadata - */ - public QueryResultMetadata getResultMetadata() { - return this.resultMetadata; - } - - /** - * Gets the code. - * - *

The internal status code returned by the ingestion subsystem indicating the overall result - * of ingesting the source document. - * - * @return the code - */ - public Long getCode() { - return this.code; - } - - /** - * Gets the filename. - * - *

Name of the original source file (if available). - * - * @return the filename - */ - public String getFilename() { - return this.filename; - } - - /** - * Gets the fileType. - * - *

The type of the original source file. - * - * @return the fileType - */ - public String getFileType() { - return this.fileType; - } - - /** - * Gets the sha1. - * - *

The SHA-1 hash of the original source file (formatted as a hexadecimal string). - * - * @return the sha1 - */ - public String getSha1() { - return this.sha1; - } - - /** - * Gets the notices. - * - *

Array of notices for the document. - * - * @return the notices - */ - public List getNotices() { - return this.notices; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryOptions.java deleted file mode 100644 index 65a598ebf47..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryOptions.java +++ /dev/null @@ -1,703 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The query options. */ -public class QueryOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String filter; - protected String query; - protected String naturalLanguageQuery; - protected Boolean passages; - protected String aggregation; - protected Long count; - protected String xReturn; - protected Long offset; - protected String sort; - protected Boolean highlight; - protected String passagesFields; - protected Long passagesCount; - protected Long passagesCharacters; - protected Boolean deduplicate; - protected String deduplicateField; - protected Boolean similar; - protected String similarDocumentIds; - protected String similarFields; - protected String bias; - protected Boolean spellingSuggestions; - protected Boolean xWatsonLoggingOptOut; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String filter; - private String query; - private String naturalLanguageQuery; - private Boolean passages; - private String aggregation; - private Long count; - private String xReturn; - private Long offset; - private String sort; - private Boolean highlight; - private String passagesFields; - private Long passagesCount; - private Long passagesCharacters; - private Boolean deduplicate; - private String deduplicateField; - private Boolean similar; - private String similarDocumentIds; - private String similarFields; - private String bias; - private Boolean spellingSuggestions; - private Boolean xWatsonLoggingOptOut; - - /** - * Instantiates a new Builder from an existing QueryOptions instance. - * - * @param queryOptions the instance to initialize the Builder with - */ - private Builder(QueryOptions queryOptions) { - this.environmentId = queryOptions.environmentId; - this.collectionId = queryOptions.collectionId; - this.filter = queryOptions.filter; - this.query = queryOptions.query; - this.naturalLanguageQuery = queryOptions.naturalLanguageQuery; - this.passages = queryOptions.passages; - this.aggregation = queryOptions.aggregation; - this.count = queryOptions.count; - this.xReturn = queryOptions.xReturn; - this.offset = queryOptions.offset; - this.sort = queryOptions.sort; - this.highlight = queryOptions.highlight; - this.passagesFields = queryOptions.passagesFields; - this.passagesCount = queryOptions.passagesCount; - this.passagesCharacters = queryOptions.passagesCharacters; - this.deduplicate = queryOptions.deduplicate; - this.deduplicateField = queryOptions.deduplicateField; - this.similar = queryOptions.similar; - this.similarDocumentIds = queryOptions.similarDocumentIds; - this.similarFields = queryOptions.similarFields; - this.bias = queryOptions.bias; - this.spellingSuggestions = queryOptions.spellingSuggestions; - this.xWatsonLoggingOptOut = queryOptions.xWatsonLoggingOptOut; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - /** - * Builds a QueryOptions. - * - * @return the new QueryOptions instance - */ - public QueryOptions build() { - return new QueryOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the QueryOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the QueryOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the filter. - * - * @param filter the filter - * @return the QueryOptions builder - */ - public Builder filter(String filter) { - this.filter = filter; - return this; - } - - /** - * Set the query. - * - * @param query the query - * @return the QueryOptions builder - */ - public Builder query(String query) { - this.query = query; - return this; - } - - /** - * Set the naturalLanguageQuery. - * - * @param naturalLanguageQuery the naturalLanguageQuery - * @return the QueryOptions builder - */ - public Builder naturalLanguageQuery(String naturalLanguageQuery) { - this.naturalLanguageQuery = naturalLanguageQuery; - return this; - } - - /** - * Set the passages. - * - * @param passages the passages - * @return the QueryOptions builder - */ - public Builder passages(Boolean passages) { - this.passages = passages; - return this; - } - - /** - * Set the aggregation. - * - * @param aggregation the aggregation - * @return the QueryOptions builder - */ - public Builder aggregation(String aggregation) { - this.aggregation = aggregation; - return this; - } - - /** - * Set the count. - * - * @param count the count - * @return the QueryOptions builder - */ - public Builder count(long count) { - this.count = count; - return this; - } - - /** - * Set the xReturn. - * - * @param xReturn the xReturn - * @return the QueryOptions builder - */ - public Builder xReturn(String xReturn) { - this.xReturn = xReturn; - return this; - } - - /** - * Set the offset. - * - * @param offset the offset - * @return the QueryOptions builder - */ - public Builder offset(long offset) { - this.offset = offset; - return this; - } - - /** - * Set the sort. - * - * @param sort the sort - * @return the QueryOptions builder - */ - public Builder sort(String sort) { - this.sort = sort; - return this; - } - - /** - * Set the highlight. - * - * @param highlight the highlight - * @return the QueryOptions builder - */ - public Builder highlight(Boolean highlight) { - this.highlight = highlight; - return this; - } - - /** - * Set the passagesFields. - * - * @param passagesFields the passagesFields - * @return the QueryOptions builder - */ - public Builder passagesFields(String passagesFields) { - this.passagesFields = passagesFields; - return this; - } - - /** - * Set the passagesCount. - * - * @param passagesCount the passagesCount - * @return the QueryOptions builder - */ - public Builder passagesCount(long passagesCount) { - this.passagesCount = passagesCount; - return this; - } - - /** - * Set the passagesCharacters. - * - * @param passagesCharacters the passagesCharacters - * @return the QueryOptions builder - */ - public Builder passagesCharacters(long passagesCharacters) { - this.passagesCharacters = passagesCharacters; - return this; - } - - /** - * Set the deduplicate. - * - * @param deduplicate the deduplicate - * @return the QueryOptions builder - */ - public Builder deduplicate(Boolean deduplicate) { - this.deduplicate = deduplicate; - return this; - } - - /** - * Set the deduplicateField. - * - * @param deduplicateField the deduplicateField - * @return the QueryOptions builder - */ - public Builder deduplicateField(String deduplicateField) { - this.deduplicateField = deduplicateField; - return this; - } - - /** - * Set the similar. - * - * @param similar the similar - * @return the QueryOptions builder - */ - public Builder similar(Boolean similar) { - this.similar = similar; - return this; - } - - /** - * Set the similarDocumentIds. - * - * @param similarDocumentIds the similarDocumentIds - * @return the QueryOptions builder - */ - public Builder similarDocumentIds(String similarDocumentIds) { - this.similarDocumentIds = similarDocumentIds; - return this; - } - - /** - * Set the similarFields. - * - * @param similarFields the similarFields - * @return the QueryOptions builder - */ - public Builder similarFields(String similarFields) { - this.similarFields = similarFields; - return this; - } - - /** - * Set the bias. - * - * @param bias the bias - * @return the QueryOptions builder - */ - public Builder bias(String bias) { - this.bias = bias; - return this; - } - - /** - * Set the spellingSuggestions. - * - * @param spellingSuggestions the spellingSuggestions - * @return the QueryOptions builder - */ - public Builder spellingSuggestions(Boolean spellingSuggestions) { - this.spellingSuggestions = spellingSuggestions; - return this; - } - - /** - * Set the xWatsonLoggingOptOut. - * - * @param xWatsonLoggingOptOut the xWatsonLoggingOptOut - * @return the QueryOptions builder - */ - public Builder xWatsonLoggingOptOut(Boolean xWatsonLoggingOptOut) { - this.xWatsonLoggingOptOut = xWatsonLoggingOptOut; - return this; - } - } - - protected QueryOptions() {} - - protected QueryOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - filter = builder.filter; - query = builder.query; - naturalLanguageQuery = builder.naturalLanguageQuery; - passages = builder.passages; - aggregation = builder.aggregation; - count = builder.count; - xReturn = builder.xReturn; - offset = builder.offset; - sort = builder.sort; - highlight = builder.highlight; - passagesFields = builder.passagesFields; - passagesCount = builder.passagesCount; - passagesCharacters = builder.passagesCharacters; - deduplicate = builder.deduplicate; - deduplicateField = builder.deduplicateField; - similar = builder.similar; - similarDocumentIds = builder.similarDocumentIds; - similarFields = builder.similarFields; - bias = builder.bias; - spellingSuggestions = builder.spellingSuggestions; - xWatsonLoggingOptOut = builder.xWatsonLoggingOptOut; - } - - /** - * New builder. - * - * @return a QueryOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the filter. - * - *

A cacheable query that excludes documents that don't mention the query content. Filter - * searches are better for metadata-type searches and for assessing the concepts in the data set. - * - * @return the filter - */ - public String filter() { - return filter; - } - - /** - * Gets the query. - * - *

A query search returns all documents in your data set with full enrichments and full text, - * but with the most relevant documents listed first. Use a query search when you want to find the - * most relevant search results. - * - * @return the query - */ - public String query() { - return query; - } - - /** - * Gets the naturalLanguageQuery. - * - *

A natural language query that returns relevant documents by utilizing training data and - * natural language understanding. - * - * @return the naturalLanguageQuery - */ - public String naturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the passages. - * - *

A passages query that returns the most relevant passages from the results. - * - * @return the passages - */ - public Boolean passages() { - return passages; - } - - /** - * Gets the aggregation. - * - *

An aggregation search that returns an exact answer by combining query search with filters. - * Useful for applications to build lists, tables, and time series. For a full list of possible - * aggregations, see the Query reference. - * - * @return the aggregation - */ - public String aggregation() { - return aggregation; - } - - /** - * Gets the count. - * - *

Number of results to return. - * - * @return the count - */ - public Long count() { - return count; - } - - /** - * Gets the xReturn. - * - *

A comma-separated list of the portion of the document hierarchy to return. - * - * @return the xReturn - */ - public String xReturn() { - return xReturn; - } - - /** - * Gets the offset. - * - *

The number of query results to skip at the beginning. For example, if the total number of - * results that are returned is 10 and the offset is 8, it returns the last two results. - * - * @return the offset - */ - public Long offset() { - return offset; - } - - /** - * Gets the sort. - * - *

A comma-separated list of fields in the document to sort on. You can optionally specify a - * sort direction by prefixing the field with `-` for descending or `+` for ascending. Ascending - * is the default sort direction if no prefix is specified. This parameter cannot be used in the - * same query as the **bias** parameter. - * - * @return the sort - */ - public String sort() { - return sort; - } - - /** - * Gets the highlight. - * - *

When true, a highlight field is returned for each result which contains the fields which - * match the query with `<em></em>` tags around the matching query terms. - * - * @return the highlight - */ - public Boolean highlight() { - return highlight; - } - - /** - * Gets the passagesFields. - * - *

A comma-separated list of fields that passages are drawn from. If this parameter not - * specified, then all top-level fields are included. - * - * @return the passagesFields - */ - public String passagesFields() { - return passagesFields; - } - - /** - * Gets the passagesCount. - * - *

The maximum number of passages to return. The search returns fewer passages if the requested - * total is not found. The default is `10`. The maximum is `100`. - * - * @return the passagesCount - */ - public Long passagesCount() { - return passagesCount; - } - - /** - * Gets the passagesCharacters. - * - *

The approximate number of characters that any one passage will have. - * - * @return the passagesCharacters - */ - public Long passagesCharacters() { - return passagesCharacters; - } - - /** - * Gets the deduplicate. - * - *

When `true`, and used with a Watson Discovery News collection, duplicate results (based on - * the contents of the **title** field) are removed. Duplicate comparison is limited to the - * current query only; **offset** is not considered. This parameter is currently Beta - * functionality. - * - * @return the deduplicate - */ - public Boolean deduplicate() { - return deduplicate; - } - - /** - * Gets the deduplicateField. - * - *

When specified, duplicate results based on the field specified are removed from the returned - * results. Duplicate comparison is limited to the current query only, **offset** is not - * considered. This parameter is currently Beta functionality. - * - * @return the deduplicateField - */ - public String deduplicateField() { - return deduplicateField; - } - - /** - * Gets the similar. - * - *

When `true`, results are returned based on their similarity to the document IDs specified in - * the **similar.document_ids** parameter. - * - * @return the similar - */ - public Boolean similar() { - return similar; - } - - /** - * Gets the similarDocumentIds. - * - *

A comma-separated list of document IDs to find similar documents. - * - *

**Tip:** Include the **natural_language_query** parameter to expand the scope of the - * document similarity search with the natural language query. Other query parameters, such as - * **filter** and **query**, are subsequently applied and reduce the scope. - * - * @return the similarDocumentIds - */ - public String similarDocumentIds() { - return similarDocumentIds; - } - - /** - * Gets the similarFields. - * - *

A comma-separated list of field names that are used as a basis for comparison to identify - * similar documents. If not specified, the entire document is used for comparison. - * - * @return the similarFields - */ - public String similarFields() { - return similarFields; - } - - /** - * Gets the bias. - * - *

Field which the returned results will be biased against. The specified field must be either - * a **date** or **number** format. When a **date** type field is specified returned results are - * biased towards field values closer to the current date. When a **number** type field is - * specified, returned results are biased towards higher field values. This parameter cannot be - * used in the same query as the **sort** parameter. - * - * @return the bias - */ - public String bias() { - return bias; - } - - /** - * Gets the spellingSuggestions. - * - *

When `true` and the **natural_language_query** parameter is used, the - * **natural_languge_query** parameter is spell checked. The most likely correction is returned in - * the **suggested_query** field of the response (if one exists). - * - *

**Important:** this parameter is only valid when using the Cloud Pak version of Discovery. - * - * @return the spellingSuggestions - */ - public Boolean spellingSuggestions() { - return spellingSuggestions; - } - - /** - * Gets the xWatsonLoggingOptOut. - * - *

If `true`, queries are not stored in the Discovery **Logs** endpoint. - * - * @return the xWatsonLoggingOptOut - */ - public Boolean xWatsonLoggingOptOut() { - return xWatsonLoggingOptOut; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryPassages.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryPassages.java deleted file mode 100644 index f2a12ecf783..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryPassages.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** A passage query result. */ -public class QueryPassages extends GenericModel { - - @SerializedName("document_id") - protected String documentId; - - @SerializedName("passage_score") - protected Double passageScore; - - @SerializedName("passage_text") - protected String passageText; - - @SerializedName("start_offset") - protected Long startOffset; - - @SerializedName("end_offset") - protected Long endOffset; - - protected String field; - - protected QueryPassages() {} - - /** - * Gets the documentId. - * - *

The unique identifier of the document from which the passage has been extracted. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the passageScore. - * - *

The confidence score of the passages's analysis. A higher score indicates greater - * confidence. - * - * @return the passageScore - */ - public Double getPassageScore() { - return passageScore; - } - - /** - * Gets the passageText. - * - *

The content of the extracted passage. - * - * @return the passageText - */ - public String getPassageText() { - return passageText; - } - - /** - * Gets the startOffset. - * - *

The position of the first character of the extracted passage in the originating field. - * - * @return the startOffset - */ - public Long getStartOffset() { - return startOffset; - } - - /** - * Gets the endOffset. - * - *

The position of the last character of the extracted passage in the originating field. - * - * @return the endOffset - */ - public Long getEndOffset() { - return endOffset; - } - - /** - * Gets the field. - * - *

The label of the field from which the passage has been extracted. - * - * @return the field - */ - public String getField() { - return field; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResponse.java deleted file mode 100644 index 1df29298087..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** A response containing the documents and aggregations for the query. */ -public class QueryResponse extends GenericModel { - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List results; - protected List aggregations; - protected List passages; - - @SerializedName("duplicates_removed") - protected Long duplicatesRemoved; - - @SerializedName("session_token") - protected String sessionToken; - - @SerializedName("retrieval_details") - protected RetrievalDetails retrievalDetails; - - @SerializedName("suggested_query") - protected String suggestedQuery; - - protected QueryResponse() {} - - /** - * Gets the matchingResults. - * - *

The number of matching results for the query. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the results. - * - *

Array of document results for the query. - * - * @return the results - */ - public List getResults() { - return results; - } - - /** - * Gets the aggregations. - * - *

Array of aggregation results for the query. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } - - /** - * Gets the passages. - * - *

Array of passage results for the query. - * - * @return the passages - */ - public List getPassages() { - return passages; - } - - /** - * Gets the duplicatesRemoved. - * - *

The number of duplicate results removed. - * - * @return the duplicatesRemoved - */ - public Long getDuplicatesRemoved() { - return duplicatesRemoved; - } - - /** - * Gets the sessionToken. - * - *

The session token for this query. The session token can be used to add events associated - * with this query to the query and event log. - * - *

**Important:** Session tokens are case sensitive. - * - * @return the sessionToken - */ - public String getSessionToken() { - return sessionToken; - } - - /** - * Gets the retrievalDetails. - * - *

An object contain retrieval type information. - * - * @return the retrievalDetails - */ - public RetrievalDetails getRetrievalDetails() { - return retrievalDetails; - } - - /** - * Gets the suggestedQuery. - * - *

The suggestions for a misspelled natural language query. - * - * @return the suggestedQuery - */ - public String getSuggestedQuery() { - return suggestedQuery; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResult.java deleted file mode 100644 index eebea29e8e1..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResult.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.google.gson.reflect.TypeToken; -import com.ibm.cloud.sdk.core.service.model.DynamicModel; -import java.util.Map; - -/** Query result object. */ -public class QueryResult extends DynamicModel { - - @SerializedName("id") - protected String id; - - @SerializedName("metadata") - protected Map metadata; - - @SerializedName("collection_id") - protected String collectionId; - - @SerializedName("result_metadata") - protected QueryResultMetadata resultMetadata; - - public QueryResult() { - super(new TypeToken() {}); - } - - /** - * Gets the id. - * - *

The unique identifier of the document. - * - * @return the id - */ - public String getId() { - return this.id; - } - - /** - * Gets the metadata. - * - *

Metadata of the document. - * - * @return the metadata - */ - public Map getMetadata() { - return this.metadata; - } - - /** - * Gets the collectionId. - * - *

The collection ID of the collection containing the document for this result. - * - * @return the collectionId - */ - public String getCollectionId() { - return this.collectionId; - } - - /** - * Gets the resultMetadata. - * - *

Metadata of a query result. - * - * @return the resultMetadata - */ - public QueryResultMetadata getResultMetadata() { - return this.resultMetadata; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResultMetadata.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResultMetadata.java deleted file mode 100644 index e6e294229d8..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryResultMetadata.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Metadata of a query result. */ -public class QueryResultMetadata extends GenericModel { - - protected Double score; - protected Double confidence; - - protected QueryResultMetadata() {} - - /** - * Gets the score. - * - *

An unbounded measure of the relevance of a particular result, dependent on the query and - * matching document. A higher score indicates a greater match to the query parameters. - * - * @return the score - */ - public Double getScore() { - return score; - } - - /** - * Gets the confidence. - * - *

The confidence score for the given result. Calculated based on how relevant the result is - * estimated to be. confidence can range from `0.0` to `1.0`. The higher the number, the more - * relevant the document. The `confidence` value for a result was calculated using the model - * specified in the `document_retrieval_strategy` field of the result set. - * - * @return the confidence - */ - public Double getConfidence() { - return confidence; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTermAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTermAggregation.java deleted file mode 100644 index 042e60b6221..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTermAggregation.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import java.util.List; - -/** Returns the top values for the field specified. */ -public class QueryTermAggregation extends QueryAggregation { - - protected String field; - protected Long count; - protected String name; - protected List results; - - protected QueryTermAggregation() {} - - /** - * Gets the field. - * - *

The field in the document used to generate top values from. - * - * @return the field - */ - public String getField() { - return field; - } - - /** - * Gets the count. - * - *

The number of top values returned. - * - * @return the count - */ - public Long getCount() { - return count; - } - - /** - * Gets the name. - * - *

Identifier specified in the query request of this aggregation. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the results. - * - *

Array of top values for the field. - * - * @return the results - */ - public List getResults() { - return results; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationResult.java deleted file mode 100644 index fadb524a0b7..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationResult.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Top value result for the term aggregation. */ -public class QueryTermAggregationResult extends GenericModel { - - protected String key; - - @SerializedName("matching_results") - protected Long matchingResults; - - protected Double relevancy; - - @SerializedName("total_matching_documents") - protected Long totalMatchingDocuments; - - @SerializedName("estimated_matching_documents") - protected Long estimatedMatchingDocuments; - - protected List aggregations; - - protected QueryTermAggregationResult() {} - - /** - * Gets the key. - * - *

Value of the field with a non-zero frequency in the document set. - * - * @return the key - */ - public String getKey() { - return key; - } - - /** - * Gets the matchingResults. - * - *

Number of documents that contain the 'key'. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the relevancy. - * - *

The relevancy for this term. - * - * @return the relevancy - */ - public Double getRelevancy() { - return relevancy; - } - - /** - * Gets the totalMatchingDocuments. - * - *

The number of documents which have the term as the value of specified field in the whole set - * of documents in this collection. Returned only when the `relevancy` parameter is set to `true`. - * - * @return the totalMatchingDocuments - */ - public Long getTotalMatchingDocuments() { - return totalMatchingDocuments; - } - - /** - * Gets the estimatedMatchingDocuments. - * - *

The estimated number of documents which would match the query and also meet the condition. - * Returned only when the `relevancy` parameter is set to `true`. - * - * @return the estimatedMatchingDocuments - */ - public Long getEstimatedMatchingDocuments() { - return estimatedMatchingDocuments; - } - - /** - * Gets the aggregations. - * - *

An array of sub-aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregation.java deleted file mode 100644 index 9b664c111a6..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregation.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import java.util.List; - -/** A specialized histogram aggregation that uses dates to create interval segments. */ -public class QueryTimesliceAggregation extends QueryAggregation { - - protected String field; - protected String interval; - protected String name; - protected List results; - - protected QueryTimesliceAggregation() {} - - /** - * Gets the field. - * - *

The date field name used to create the timeslice. - * - * @return the field - */ - public String getField() { - return field; - } - - /** - * Gets the interval. - * - *

The date interval value. Valid values are seconds, minutes, hours, days, weeks, and years. - * - * @return the interval - */ - public String getInterval() { - return interval; - } - - /** - * Gets the name. - * - *

Identifier specified in the query request of this aggregation. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the results. - * - *

Array of aggregation results. - * - * @return the results - */ - public List getResults() { - return results; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationResult.java deleted file mode 100644 index fc42778b42e..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationResult.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** A timeslice interval segment. */ -public class QueryTimesliceAggregationResult extends GenericModel { - - @SerializedName("key_as_string") - protected String keyAsString; - - protected Long key; - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List aggregations; - - protected QueryTimesliceAggregationResult() {} - - /** - * Gets the keyAsString. - * - *

String date value of the upper bound for the timeslice interval in ISO-8601 format. - * - * @return the keyAsString - */ - public String getKeyAsString() { - return keyAsString; - } - - /** - * Gets the key. - * - *

Numeric date value of the upper bound for the timeslice interval in UNIX milliseconds since - * epoch. - * - * @return the key - */ - public Long getKey() { - return key; - } - - /** - * Gets the matchingResults. - * - *

Number of documents with the specified key as the upper bound. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the aggregations. - * - *

An array of sub-aggregations. - * - * @return the aggregations - */ - public List getAggregations() { - return aggregations; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregation.java deleted file mode 100644 index 0d3071527fd..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregation.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -/** Returns the top documents ranked by the score of the query. */ -public class QueryTopHitsAggregation extends QueryAggregation { - - protected Long size; - protected String name; - protected QueryTopHitsAggregationResult hits; - - protected QueryTopHitsAggregation() {} - - /** - * Gets the size. - * - *

The number of documents to return. - * - * @return the size - */ - public Long getSize() { - return size; - } - - /** - * Gets the name. - * - *

Identifier specified in the query request of this aggregation. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the hits. - * - * @return the hits - */ - public QueryTopHitsAggregationResult getHits() { - return hits; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationResult.java deleted file mode 100644 index b7b8a98a041..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationResult.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; -import java.util.Map; - -/** A query response that contains the matching documents for the preceding aggregations. */ -public class QueryTopHitsAggregationResult extends GenericModel { - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List> hits; - - protected QueryTopHitsAggregationResult() {} - - /** - * Gets the matchingResults. - * - *

Number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the hits. - * - *

An array of the document results. - * - * @return the hits - */ - public List> getHits() { - return hits; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/RetrievalDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/RetrievalDetails.java deleted file mode 100644 index f707e433d72..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/RetrievalDetails.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** An object contain retrieval type information. */ -public class RetrievalDetails extends GenericModel { - - /** - * Indentifies the document retrieval strategy used for this query. `relevancy_training` indicates - * that the results were returned using a relevancy trained model. `continuous_relevancy_training` - * indicates that the results were returned using the continuous relevancy training model created - * by result feedback analysis. `untrained` means the results were returned using the standard - * untrained model. - * - *

**Note**: In the event of trained collections being queried, but the trained model is not - * used to return results, the **document_retrieval_strategy** will be listed as `untrained`. - */ - public interface DocumentRetrievalStrategy { - /** untrained. */ - String UNTRAINED = "untrained"; - /** relevancy_training. */ - String RELEVANCY_TRAINING = "relevancy_training"; - /** continuous_relevancy_training. */ - String CONTINUOUS_RELEVANCY_TRAINING = "continuous_relevancy_training"; - } - - @SerializedName("document_retrieval_strategy") - protected String documentRetrievalStrategy; - - protected RetrievalDetails() {} - - /** - * Gets the documentRetrievalStrategy. - * - *

Indentifies the document retrieval strategy used for this query. `relevancy_training` - * indicates that the results were returned using a relevancy trained model. - * `continuous_relevancy_training` indicates that the results were returned using the continuous - * relevancy training model created by result feedback analysis. `untrained` means the results - * were returned using the standard untrained model. - * - *

**Note**: In the event of trained collections being queried, but the trained model is not - * used to return results, the **document_retrieval_strategy** will be listed as `untrained`. - * - * @return the documentRetrievalStrategy - */ - public String getDocumentRetrievalStrategy() { - return documentRetrievalStrategy; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SduStatus.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SduStatus.java deleted file mode 100644 index f44955092a1..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SduStatus.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing smart document understanding information for this collection. */ -public class SduStatus extends GenericModel { - - protected Boolean enabled; - - @SerializedName("total_annotated_pages") - protected Long totalAnnotatedPages; - - @SerializedName("total_pages") - protected Long totalPages; - - @SerializedName("total_documents") - protected Long totalDocuments; - - @SerializedName("custom_fields") - protected SduStatusCustomFields customFields; - - protected SduStatus() {} - - /** - * Gets the enabled. - * - *

When `true`, smart document understanding conversion is enabled for this collection. All - * collections created with a version date after `2019-04-30` have smart document understanding - * enabled. If `false`, documents added to the collection are converted using the **conversion** - * settings specified in the configuration associated with the collection. - * - * @return the enabled - */ - public Boolean isEnabled() { - return enabled; - } - - /** - * Gets the totalAnnotatedPages. - * - *

The total number of pages annotated using smart document understanding in this collection. - * - * @return the totalAnnotatedPages - */ - public Long getTotalAnnotatedPages() { - return totalAnnotatedPages; - } - - /** - * Gets the totalPages. - * - *

The current number of pages that can be used for training smart document understanding. The - * `total_pages` number is calculated as the total number of pages identified from the documents - * listed in the **total_documents** field. - * - * @return the totalPages - */ - public Long getTotalPages() { - return totalPages; - } - - /** - * Gets the totalDocuments. - * - *

The total number of documents in this collection that can be used to train smart document - * understanding. For **lite** plan collections, the maximum is the first 20 uploaded documents - * (not including HTML or JSON documents). For other plans, the maximum is the first 40 uploaded - * documents (not including HTML or JSON documents). When the maximum is reached, additional - * documents uploaded to the collection are not considered for training smart document - * understanding. - * - * @return the totalDocuments - */ - public Long getTotalDocuments() { - return totalDocuments; - } - - /** - * Gets the customFields. - * - *

Information about custom smart document understanding fields that exist in this collection. - * - * @return the customFields - */ - public SduStatusCustomFields getCustomFields() { - return customFields; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SduStatusCustomFields.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SduStatusCustomFields.java deleted file mode 100644 index 2225c3de2ac..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SduStatusCustomFields.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Information about custom smart document understanding fields that exist in this collection. */ -public class SduStatusCustomFields extends GenericModel { - - protected Long defined; - - @SerializedName("maximum_allowed") - protected Long maximumAllowed; - - protected SduStatusCustomFields() {} - - /** - * Gets the defined. - * - *

The number of custom fields defined for this collection. - * - * @return the defined - */ - public Long getDefined() { - return defined; - } - - /** - * Gets the maximumAllowed. - * - *

The maximum number of custom fields that are allowed in this collection. - * - * @return the maximumAllowed - */ - public Long getMaximumAllowed() { - return maximumAllowed; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SearchStatus.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SearchStatus.java deleted file mode 100644 index 24b59ef8dd6..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SearchStatus.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import com.ibm.cloud.sdk.core.util.DateTypeAdapter; -import java.util.Date; - -/** Information about the Continuous Relevancy Training for this environment. */ -public class SearchStatus extends GenericModel { - - /** The current status of Continuous Relevancy Training for this environment. */ - public interface Status { - /** NO_DATA. */ - String NO_DATA = "NO_DATA"; - /** INSUFFICENT_DATA. */ - String INSUFFICENT_DATA = "INSUFFICENT_DATA"; - /** TRAINING. */ - String TRAINING = "TRAINING"; - /** TRAINED. */ - String TRAINED = "TRAINED"; - /** NOT_APPLICABLE. */ - String NOT_APPLICABLE = "NOT_APPLICABLE"; - } - - protected String scope; - protected String status; - - @SerializedName("status_description") - protected String statusDescription; - - @JsonAdapter(DateTypeAdapter.class) - @SerializedName("last_trained") - protected Date lastTrained; - - protected SearchStatus() {} - - /** - * Gets the scope. - * - *

Current scope of the training. Always returned as `environment`. - * - * @return the scope - */ - public String getScope() { - return scope; - } - - /** - * Gets the status. - * - *

The current status of Continuous Relevancy Training for this environment. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the statusDescription. - * - *

Long description of the current Continuous Relevancy Training status. - * - * @return the statusDescription - */ - public String getStatusDescription() { - return statusDescription; - } - - /** - * Gets the lastTrained. - * - *

The date stamp of the most recent completed training for this environment. - * - * @return the lastTrained - */ - public Date getLastTrained() { - return lastTrained; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SegmentSettings.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SegmentSettings.java deleted file mode 100644 index 4e431ff8a2e..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SegmentSettings.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** A list of Document Segmentation settings. */ -public class SegmentSettings extends GenericModel { - - protected Boolean enabled; - - @SerializedName("selector_tags") - protected List selectorTags; - - @SerializedName("annotated_fields") - protected List annotatedFields; - - /** Builder. */ - public static class Builder { - private Boolean enabled; - private List selectorTags; - private List annotatedFields; - - /** - * Instantiates a new Builder from an existing SegmentSettings instance. - * - * @param segmentSettings the instance to initialize the Builder with - */ - private Builder(SegmentSettings segmentSettings) { - this.enabled = segmentSettings.enabled; - this.selectorTags = segmentSettings.selectorTags; - this.annotatedFields = segmentSettings.annotatedFields; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a SegmentSettings. - * - * @return the new SegmentSettings instance - */ - public SegmentSettings build() { - return new SegmentSettings(this); - } - - /** - * Adds a new element to selectorTags. - * - * @param selectorTags the new element to be added - * @return the SegmentSettings builder - */ - public Builder addSelectorTags(String selectorTags) { - com.ibm.cloud.sdk.core.util.Validator.notNull(selectorTags, "selectorTags cannot be null"); - if (this.selectorTags == null) { - this.selectorTags = new ArrayList(); - } - this.selectorTags.add(selectorTags); - return this; - } - - /** - * Adds a new element to annotatedFields. - * - * @param annotatedFields the new element to be added - * @return the SegmentSettings builder - */ - public Builder addAnnotatedFields(String annotatedFields) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - annotatedFields, "annotatedFields cannot be null"); - if (this.annotatedFields == null) { - this.annotatedFields = new ArrayList(); - } - this.annotatedFields.add(annotatedFields); - return this; - } - - /** - * Set the enabled. - * - * @param enabled the enabled - * @return the SegmentSettings builder - */ - public Builder enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Set the selectorTags. Existing selectorTags will be replaced. - * - * @param selectorTags the selectorTags - * @return the SegmentSettings builder - */ - public Builder selectorTags(List selectorTags) { - this.selectorTags = selectorTags; - return this; - } - - /** - * Set the annotatedFields. Existing annotatedFields will be replaced. - * - * @param annotatedFields the annotatedFields - * @return the SegmentSettings builder - */ - public Builder annotatedFields(List annotatedFields) { - this.annotatedFields = annotatedFields; - return this; - } - } - - protected SegmentSettings() {} - - protected SegmentSettings(Builder builder) { - enabled = builder.enabled; - selectorTags = builder.selectorTags; - annotatedFields = builder.annotatedFields; - } - - /** - * New builder. - * - * @return a SegmentSettings builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the enabled. - * - *

Enables/disables the Document Segmentation feature. - * - * @return the enabled - */ - public Boolean enabled() { - return enabled; - } - - /** - * Gets the selectorTags. - * - *

Defines the heading level that splits into document segments. Valid values are h1, h2, h3, - * h4, h5, h6. The content of the header field that the segmentation splits at is used as the - * **title** field for that segmented result. Only valid if used with a collection that has - * **enabled** set to `false` in the **smart_document_understanding** object. - * - * @return the selectorTags - */ - public List selectorTags() { - return selectorTags; - } - - /** - * Gets the annotatedFields. - * - *

Defines the annotated smart document understanding fields that the document is split on. The - * content of the annotated field that the segmentation splits at is used as the **title** field - * for that segmented result. For example, if the field `sub-title` is specified, when a document - * is uploaded each time the smart document understanding conversion encounters a field of type - * `sub-title` the document is split at that point and the content of the field used as the title - * of the remaining content. This split is performed for all instances of the listed fields in the - * uploaded document. Only valid if used with a collection that has **enabled** set to `true` in - * the **smart_document_understanding** object. - * - * @return the annotatedFields - */ - public List annotatedFields() { - return annotatedFields; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Source.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Source.java deleted file mode 100644 index a05838fee96..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Source.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing source parameters for the configuration. */ -public class Source extends GenericModel { - - /** - * The type of source to connect to. - `box` indicates the configuration is to connect an instance - * of Enterprise Box. - `salesforce` indicates the configuration is to connect to Salesforce. - - * `sharepoint` indicates the configuration is to connect to Microsoft SharePoint Online. - - * `web_crawl` indicates the configuration is to perform a web page crawl. - - * `cloud_object_storage` indicates the configuration is to connect to a cloud object store. - */ - public interface Type { - /** box. */ - String BOX = "box"; - /** salesforce. */ - String SALESFORCE = "salesforce"; - /** sharepoint. */ - String SHAREPOINT = "sharepoint"; - /** web_crawl. */ - String WEB_CRAWL = "web_crawl"; - /** cloud_object_storage. */ - String CLOUD_OBJECT_STORAGE = "cloud_object_storage"; - } - - protected String type; - - @SerializedName("credential_id") - protected String credentialId; - - protected SourceSchedule schedule; - protected SourceOptions options; - - /** Builder. */ - public static class Builder { - private String type; - private String credentialId; - private SourceSchedule schedule; - private SourceOptions options; - - /** - * Instantiates a new Builder from an existing Source instance. - * - * @param source the instance to initialize the Builder with - */ - private Builder(Source source) { - this.type = source.type; - this.credentialId = source.credentialId; - this.schedule = source.schedule; - this.options = source.options; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a Source. - * - * @return the new Source instance - */ - public Source build() { - return new Source(this); - } - - /** - * Set the type. - * - * @param type the type - * @return the Source builder - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Set the credentialId. - * - * @param credentialId the credentialId - * @return the Source builder - */ - public Builder credentialId(String credentialId) { - this.credentialId = credentialId; - return this; - } - - /** - * Set the schedule. - * - * @param schedule the schedule - * @return the Source builder - */ - public Builder schedule(SourceSchedule schedule) { - this.schedule = schedule; - return this; - } - - /** - * Set the options. - * - * @param options the options - * @return the Source builder - */ - public Builder options(SourceOptions options) { - this.options = options; - return this; - } - } - - protected Source() {} - - protected Source(Builder builder) { - type = builder.type; - credentialId = builder.credentialId; - schedule = builder.schedule; - options = builder.options; - } - - /** - * New builder. - * - * @return a Source builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the type. - * - *

The type of source to connect to. - `box` indicates the configuration is to connect an - * instance of Enterprise Box. - `salesforce` indicates the configuration is to connect to - * Salesforce. - `sharepoint` indicates the configuration is to connect to Microsoft SharePoint - * Online. - `web_crawl` indicates the configuration is to perform a web page crawl. - - * `cloud_object_storage` indicates the configuration is to connect to a cloud object store. - * - * @return the type - */ - public String type() { - return type; - } - - /** - * Gets the credentialId. - * - *

The **credential_id** of the credentials to use to connect to the source. Credentials are - * defined using the **credentials** method. The **source_type** of the credentials used must - * match the **type** field specified in this object. - * - * @return the credentialId - */ - public String credentialId() { - return credentialId; - } - - /** - * Gets the schedule. - * - *

Object containing the schedule information for the source. - * - * @return the schedule - */ - public SourceSchedule schedule() { - return schedule; - } - - /** - * Gets the options. - * - *

The **options** object defines which items to crawl from the source system. - * - * @return the options - */ - public SourceOptions options() { - return options; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptions.java deleted file mode 100644 index d7e04a458c5..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptions.java +++ /dev/null @@ -1,306 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The **options** object defines which items to crawl from the source system. */ -public class SourceOptions extends GenericModel { - - protected List folders; - protected List objects; - - @SerializedName("site_collections") - protected List siteCollections; - - protected List urls; - protected List buckets; - - @SerializedName("crawl_all_buckets") - protected Boolean crawlAllBuckets; - - /** Builder. */ - public static class Builder { - private List folders; - private List objects; - private List siteCollections; - private List urls; - private List buckets; - private Boolean crawlAllBuckets; - - /** - * Instantiates a new Builder from an existing SourceOptions instance. - * - * @param sourceOptions the instance to initialize the Builder with - */ - private Builder(SourceOptions sourceOptions) { - this.folders = sourceOptions.folders; - this.objects = sourceOptions.objects; - this.siteCollections = sourceOptions.siteCollections; - this.urls = sourceOptions.urls; - this.buckets = sourceOptions.buckets; - this.crawlAllBuckets = sourceOptions.crawlAllBuckets; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a SourceOptions. - * - * @return the new SourceOptions instance - */ - public SourceOptions build() { - return new SourceOptions(this); - } - - /** - * Adds a new element to folders. - * - * @param folders the new element to be added - * @return the SourceOptions builder - */ - public Builder addFolders(SourceOptionsFolder folders) { - com.ibm.cloud.sdk.core.util.Validator.notNull(folders, "folders cannot be null"); - if (this.folders == null) { - this.folders = new ArrayList(); - } - this.folders.add(folders); - return this; - } - - /** - * Adds a new element to objects. - * - * @param objects the new element to be added - * @return the SourceOptions builder - */ - public Builder addObjects(SourceOptionsObject objects) { - com.ibm.cloud.sdk.core.util.Validator.notNull(objects, "objects cannot be null"); - if (this.objects == null) { - this.objects = new ArrayList(); - } - this.objects.add(objects); - return this; - } - - /** - * Adds a new element to siteCollections. - * - * @param siteCollections the new element to be added - * @return the SourceOptions builder - */ - public Builder addSiteCollections(SourceOptionsSiteColl siteCollections) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - siteCollections, "siteCollections cannot be null"); - if (this.siteCollections == null) { - this.siteCollections = new ArrayList(); - } - this.siteCollections.add(siteCollections); - return this; - } - - /** - * Adds a new element to urls. - * - * @param urls the new element to be added - * @return the SourceOptions builder - */ - public Builder addUrls(SourceOptionsWebCrawl urls) { - com.ibm.cloud.sdk.core.util.Validator.notNull(urls, "urls cannot be null"); - if (this.urls == null) { - this.urls = new ArrayList(); - } - this.urls.add(urls); - return this; - } - - /** - * Adds a new element to buckets. - * - * @param buckets the new element to be added - * @return the SourceOptions builder - */ - public Builder addBuckets(SourceOptionsBuckets buckets) { - com.ibm.cloud.sdk.core.util.Validator.notNull(buckets, "buckets cannot be null"); - if (this.buckets == null) { - this.buckets = new ArrayList(); - } - this.buckets.add(buckets); - return this; - } - - /** - * Set the folders. Existing folders will be replaced. - * - * @param folders the folders - * @return the SourceOptions builder - */ - public Builder folders(List folders) { - this.folders = folders; - return this; - } - - /** - * Set the objects. Existing objects will be replaced. - * - * @param objects the objects - * @return the SourceOptions builder - */ - public Builder objects(List objects) { - this.objects = objects; - return this; - } - - /** - * Set the siteCollections. Existing siteCollections will be replaced. - * - * @param siteCollections the siteCollections - * @return the SourceOptions builder - */ - public Builder siteCollections(List siteCollections) { - this.siteCollections = siteCollections; - return this; - } - - /** - * Set the urls. Existing urls will be replaced. - * - * @param urls the urls - * @return the SourceOptions builder - */ - public Builder urls(List urls) { - this.urls = urls; - return this; - } - - /** - * Set the buckets. Existing buckets will be replaced. - * - * @param buckets the buckets - * @return the SourceOptions builder - */ - public Builder buckets(List buckets) { - this.buckets = buckets; - return this; - } - - /** - * Set the crawlAllBuckets. - * - * @param crawlAllBuckets the crawlAllBuckets - * @return the SourceOptions builder - */ - public Builder crawlAllBuckets(Boolean crawlAllBuckets) { - this.crawlAllBuckets = crawlAllBuckets; - return this; - } - } - - protected SourceOptions() {} - - protected SourceOptions(Builder builder) { - folders = builder.folders; - objects = builder.objects; - siteCollections = builder.siteCollections; - urls = builder.urls; - buckets = builder.buckets; - crawlAllBuckets = builder.crawlAllBuckets; - } - - /** - * New builder. - * - * @return a SourceOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the folders. - * - *

Array of folders to crawl from the Box source. Only valid, and required, when the **type** - * field of the **source** object is set to `box`. - * - * @return the folders - */ - public List folders() { - return folders; - } - - /** - * Gets the objects. - * - *

Array of Salesforce document object types to crawl from the Salesforce source. Only valid, - * and required, when the **type** field of the **source** object is set to `salesforce`. - * - * @return the objects - */ - public List objects() { - return objects; - } - - /** - * Gets the siteCollections. - * - *

Array of Microsoft SharePointoint Online site collections to crawl from the SharePoint - * source. Only valid and required when the **type** field of the **source** object is set to - * `sharepoint`. - * - * @return the siteCollections - */ - public List siteCollections() { - return siteCollections; - } - - /** - * Gets the urls. - * - *

Array of Web page URLs to begin crawling the web from. Only valid and required when the - * **type** field of the **source** object is set to `web_crawl`. - * - * @return the urls - */ - public List urls() { - return urls; - } - - /** - * Gets the buckets. - * - *

Array of cloud object store buckets to begin crawling. Only valid and required when the - * **type** field of the **source** object is set to `cloud_object_store`, and the - * **crawl_all_buckets** field is `false` or not specified. - * - * @return the buckets - */ - public List buckets() { - return buckets; - } - - /** - * Gets the crawlAllBuckets. - * - *

When `true`, all buckets in the specified cloud object store are crawled. If set to `true`, - * the **buckets** array must not be specified. - * - * @return the crawlAllBuckets - */ - public Boolean crawlAllBuckets() { - return crawlAllBuckets; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsBuckets.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsBuckets.java deleted file mode 100644 index 60e4c4ac75d..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsBuckets.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object defining a cloud object store bucket to crawl. */ -public class SourceOptionsBuckets extends GenericModel { - - protected String name; - protected Long limit; - - /** Builder. */ - public static class Builder { - private String name; - private Long limit; - - /** - * Instantiates a new Builder from an existing SourceOptionsBuckets instance. - * - * @param sourceOptionsBuckets the instance to initialize the Builder with - */ - private Builder(SourceOptionsBuckets sourceOptionsBuckets) { - this.name = sourceOptionsBuckets.name; - this.limit = sourceOptionsBuckets.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param name the name - */ - public Builder(String name) { - this.name = name; - } - - /** - * Builds a SourceOptionsBuckets. - * - * @return the new SourceOptionsBuckets instance - */ - public SourceOptionsBuckets build() { - return new SourceOptionsBuckets(this); - } - - /** - * Set the name. - * - * @param name the name - * @return the SourceOptionsBuckets builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the SourceOptionsBuckets builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected SourceOptionsBuckets() {} - - protected SourceOptionsBuckets(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - name = builder.name; - limit = builder.limit; - } - - /** - * New builder. - * - * @return a SourceOptionsBuckets builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the name. - * - *

The name of the cloud object store bucket to crawl. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the limit. - * - *

The number of documents to crawl from this cloud object store bucket. If not specified, all - * documents in the bucket are crawled. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsFolder.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsFolder.java deleted file mode 100644 index 2f018106607..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsFolder.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object that defines a box folder to crawl with this configuration. */ -public class SourceOptionsFolder extends GenericModel { - - @SerializedName("owner_user_id") - protected String ownerUserId; - - @SerializedName("folder_id") - protected String folderId; - - protected Long limit; - - /** Builder. */ - public static class Builder { - private String ownerUserId; - private String folderId; - private Long limit; - - /** - * Instantiates a new Builder from an existing SourceOptionsFolder instance. - * - * @param sourceOptionsFolder the instance to initialize the Builder with - */ - private Builder(SourceOptionsFolder sourceOptionsFolder) { - this.ownerUserId = sourceOptionsFolder.ownerUserId; - this.folderId = sourceOptionsFolder.folderId; - this.limit = sourceOptionsFolder.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param ownerUserId the ownerUserId - * @param folderId the folderId - */ - public Builder(String ownerUserId, String folderId) { - this.ownerUserId = ownerUserId; - this.folderId = folderId; - } - - /** - * Builds a SourceOptionsFolder. - * - * @return the new SourceOptionsFolder instance - */ - public SourceOptionsFolder build() { - return new SourceOptionsFolder(this); - } - - /** - * Set the ownerUserId. - * - * @param ownerUserId the ownerUserId - * @return the SourceOptionsFolder builder - */ - public Builder ownerUserId(String ownerUserId) { - this.ownerUserId = ownerUserId; - return this; - } - - /** - * Set the folderId. - * - * @param folderId the folderId - * @return the SourceOptionsFolder builder - */ - public Builder folderId(String folderId) { - this.folderId = folderId; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the SourceOptionsFolder builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected SourceOptionsFolder() {} - - protected SourceOptionsFolder(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.ownerUserId, "ownerUserId cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.folderId, "folderId cannot be null"); - ownerUserId = builder.ownerUserId; - folderId = builder.folderId; - limit = builder.limit; - } - - /** - * New builder. - * - * @return a SourceOptionsFolder builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the ownerUserId. - * - *

The Box user ID of the user who owns the folder to crawl. - * - * @return the ownerUserId - */ - public String ownerUserId() { - return ownerUserId; - } - - /** - * Gets the folderId. - * - *

The Box folder ID of the folder to crawl. - * - * @return the folderId - */ - public String folderId() { - return folderId; - } - - /** - * Gets the limit. - * - *

The maximum number of documents to crawl for this folder. By default, all documents in the - * folder are crawled. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsObject.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsObject.java deleted file mode 100644 index 8b95e6216d0..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsObject.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object that defines a Salesforce document object type crawl with this configuration. */ -public class SourceOptionsObject extends GenericModel { - - protected String name; - protected Long limit; - - /** Builder. */ - public static class Builder { - private String name; - private Long limit; - - /** - * Instantiates a new Builder from an existing SourceOptionsObject instance. - * - * @param sourceOptionsObject the instance to initialize the Builder with - */ - private Builder(SourceOptionsObject sourceOptionsObject) { - this.name = sourceOptionsObject.name; - this.limit = sourceOptionsObject.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param name the name - */ - public Builder(String name) { - this.name = name; - } - - /** - * Builds a SourceOptionsObject. - * - * @return the new SourceOptionsObject instance - */ - public SourceOptionsObject build() { - return new SourceOptionsObject(this); - } - - /** - * Set the name. - * - * @param name the name - * @return the SourceOptionsObject builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the SourceOptionsObject builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected SourceOptionsObject() {} - - protected SourceOptionsObject(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - name = builder.name; - limit = builder.limit; - } - - /** - * New builder. - * - * @return a SourceOptionsObject builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the name. - * - *

The name of the Salesforce document object to crawl. For example, `case`. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the limit. - * - *

The maximum number of documents to crawl for this document object. By default, all documents - * in the document object are crawled. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsSiteColl.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsSiteColl.java deleted file mode 100644 index 8cc93bbf7a7..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsSiteColl.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object that defines a Microsoft SharePoint site collection to crawl with this configuration. */ -public class SourceOptionsSiteColl extends GenericModel { - - @SerializedName("site_collection_path") - protected String siteCollectionPath; - - protected Long limit; - - /** Builder. */ - public static class Builder { - private String siteCollectionPath; - private Long limit; - - /** - * Instantiates a new Builder from an existing SourceOptionsSiteColl instance. - * - * @param sourceOptionsSiteColl the instance to initialize the Builder with - */ - private Builder(SourceOptionsSiteColl sourceOptionsSiteColl) { - this.siteCollectionPath = sourceOptionsSiteColl.siteCollectionPath; - this.limit = sourceOptionsSiteColl.limit; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param siteCollectionPath the siteCollectionPath - */ - public Builder(String siteCollectionPath) { - this.siteCollectionPath = siteCollectionPath; - } - - /** - * Builds a SourceOptionsSiteColl. - * - * @return the new SourceOptionsSiteColl instance - */ - public SourceOptionsSiteColl build() { - return new SourceOptionsSiteColl(this); - } - - /** - * Set the siteCollectionPath. - * - * @param siteCollectionPath the siteCollectionPath - * @return the SourceOptionsSiteColl builder - */ - public Builder siteCollectionPath(String siteCollectionPath) { - this.siteCollectionPath = siteCollectionPath; - return this; - } - - /** - * Set the limit. - * - * @param limit the limit - * @return the SourceOptionsSiteColl builder - */ - public Builder limit(long limit) { - this.limit = limit; - return this; - } - } - - protected SourceOptionsSiteColl() {} - - protected SourceOptionsSiteColl(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.siteCollectionPath, "siteCollectionPath cannot be null"); - siteCollectionPath = builder.siteCollectionPath; - limit = builder.limit; - } - - /** - * New builder. - * - * @return a SourceOptionsSiteColl builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the siteCollectionPath. - * - *

The Microsoft SharePoint Online site collection path to crawl. The path must be be relative - * to the **organization_url** that was specified in the credentials associated with this source - * configuration. - * - * @return the siteCollectionPath - */ - public String siteCollectionPath() { - return siteCollectionPath; - } - - /** - * Gets the limit. - * - *

The maximum number of documents to crawl for this site collection. By default, all documents - * in the site collection are crawled. - * - * @return the limit - */ - public Long limit() { - return limit; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsWebCrawl.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsWebCrawl.java deleted file mode 100644 index 82053c1e190..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceOptionsWebCrawl.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** Object defining which URL to crawl and how to crawl it. */ -public class SourceOptionsWebCrawl extends GenericModel { - - /** - * The number of concurrent URLs to fetch. `gentle` means one URL is fetched at a time with a - * delay between each call. `normal` means as many as two URLs are fectched concurrently with a - * short delay between fetch calls. `aggressive` means that up to ten URLs are fetched - * concurrently with a short delay between fetch calls. - */ - public interface CrawlSpeed { - /** gentle. */ - String GENTLE = "gentle"; - /** normal. */ - String NORMAL = "normal"; - /** aggressive. */ - String AGGRESSIVE = "aggressive"; - } - - protected String url; - - @SerializedName("limit_to_starting_hosts") - protected Boolean limitToStartingHosts; - - @SerializedName("crawl_speed") - protected String crawlSpeed; - - @SerializedName("allow_untrusted_certificate") - protected Boolean allowUntrustedCertificate; - - @SerializedName("maximum_hops") - protected Long maximumHops; - - @SerializedName("request_timeout") - protected Long requestTimeout; - - @SerializedName("override_robots_txt") - protected Boolean overrideRobotsTxt; - - protected List blacklist; - - /** Builder. */ - public static class Builder { - private String url; - private Boolean limitToStartingHosts; - private String crawlSpeed; - private Boolean allowUntrustedCertificate; - private Long maximumHops; - private Long requestTimeout; - private Boolean overrideRobotsTxt; - private List blacklist; - - /** - * Instantiates a new Builder from an existing SourceOptionsWebCrawl instance. - * - * @param sourceOptionsWebCrawl the instance to initialize the Builder with - */ - private Builder(SourceOptionsWebCrawl sourceOptionsWebCrawl) { - this.url = sourceOptionsWebCrawl.url; - this.limitToStartingHosts = sourceOptionsWebCrawl.limitToStartingHosts; - this.crawlSpeed = sourceOptionsWebCrawl.crawlSpeed; - this.allowUntrustedCertificate = sourceOptionsWebCrawl.allowUntrustedCertificate; - this.maximumHops = sourceOptionsWebCrawl.maximumHops; - this.requestTimeout = sourceOptionsWebCrawl.requestTimeout; - this.overrideRobotsTxt = sourceOptionsWebCrawl.overrideRobotsTxt; - this.blacklist = sourceOptionsWebCrawl.blacklist; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param url the url - */ - public Builder(String url) { - this.url = url; - } - - /** - * Builds a SourceOptionsWebCrawl. - * - * @return the new SourceOptionsWebCrawl instance - */ - public SourceOptionsWebCrawl build() { - return new SourceOptionsWebCrawl(this); - } - - /** - * Adds a new element to blacklist. - * - * @param blacklist the new element to be added - * @return the SourceOptionsWebCrawl builder - */ - public Builder addBlacklist(String blacklist) { - com.ibm.cloud.sdk.core.util.Validator.notNull(blacklist, "blacklist cannot be null"); - if (this.blacklist == null) { - this.blacklist = new ArrayList(); - } - this.blacklist.add(blacklist); - return this; - } - - /** - * Set the url. - * - * @param url the url - * @return the SourceOptionsWebCrawl builder - */ - public Builder url(String url) { - this.url = url; - return this; - } - - /** - * Set the limitToStartingHosts. - * - * @param limitToStartingHosts the limitToStartingHosts - * @return the SourceOptionsWebCrawl builder - */ - public Builder limitToStartingHosts(Boolean limitToStartingHosts) { - this.limitToStartingHosts = limitToStartingHosts; - return this; - } - - /** - * Set the crawlSpeed. - * - * @param crawlSpeed the crawlSpeed - * @return the SourceOptionsWebCrawl builder - */ - public Builder crawlSpeed(String crawlSpeed) { - this.crawlSpeed = crawlSpeed; - return this; - } - - /** - * Set the allowUntrustedCertificate. - * - * @param allowUntrustedCertificate the allowUntrustedCertificate - * @return the SourceOptionsWebCrawl builder - */ - public Builder allowUntrustedCertificate(Boolean allowUntrustedCertificate) { - this.allowUntrustedCertificate = allowUntrustedCertificate; - return this; - } - - /** - * Set the maximumHops. - * - * @param maximumHops the maximumHops - * @return the SourceOptionsWebCrawl builder - */ - public Builder maximumHops(long maximumHops) { - this.maximumHops = maximumHops; - return this; - } - - /** - * Set the requestTimeout. - * - * @param requestTimeout the requestTimeout - * @return the SourceOptionsWebCrawl builder - */ - public Builder requestTimeout(long requestTimeout) { - this.requestTimeout = requestTimeout; - return this; - } - - /** - * Set the overrideRobotsTxt. - * - * @param overrideRobotsTxt the overrideRobotsTxt - * @return the SourceOptionsWebCrawl builder - */ - public Builder overrideRobotsTxt(Boolean overrideRobotsTxt) { - this.overrideRobotsTxt = overrideRobotsTxt; - return this; - } - - /** - * Set the blacklist. Existing blacklist will be replaced. - * - * @param blacklist the blacklist - * @return the SourceOptionsWebCrawl builder - */ - public Builder blacklist(List blacklist) { - this.blacklist = blacklist; - return this; - } - } - - protected SourceOptionsWebCrawl() {} - - protected SourceOptionsWebCrawl(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.url, "url cannot be null"); - url = builder.url; - limitToStartingHosts = builder.limitToStartingHosts; - crawlSpeed = builder.crawlSpeed; - allowUntrustedCertificate = builder.allowUntrustedCertificate; - maximumHops = builder.maximumHops; - requestTimeout = builder.requestTimeout; - overrideRobotsTxt = builder.overrideRobotsTxt; - blacklist = builder.blacklist; - } - - /** - * New builder. - * - * @return a SourceOptionsWebCrawl builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the url. - * - *

The starting URL to crawl. - * - * @return the url - */ - public String url() { - return url; - } - - /** - * Gets the limitToStartingHosts. - * - *

When `true`, crawls of the specified URL are limited to the host part of the **url** field. - * - * @return the limitToStartingHosts - */ - public Boolean limitToStartingHosts() { - return limitToStartingHosts; - } - - /** - * Gets the crawlSpeed. - * - *

The number of concurrent URLs to fetch. `gentle` means one URL is fetched at a time with a - * delay between each call. `normal` means as many as two URLs are fectched concurrently with a - * short delay between fetch calls. `aggressive` means that up to ten URLs are fetched - * concurrently with a short delay between fetch calls. - * - * @return the crawlSpeed - */ - public String crawlSpeed() { - return crawlSpeed; - } - - /** - * Gets the allowUntrustedCertificate. - * - *

When `true`, allows the crawl to interact with HTTPS sites with SSL certificates with - * untrusted signers. - * - * @return the allowUntrustedCertificate - */ - public Boolean allowUntrustedCertificate() { - return allowUntrustedCertificate; - } - - /** - * Gets the maximumHops. - * - *

The maximum number of hops to make from the initial URL. When a page is crawled each link on - * that page will also be crawled if it is within the **maximum_hops** from the initial URL. The - * first page crawled is 0 hops, each link crawled from the first page is 1 hop, each link crawled - * from those pages is 2 hops, and so on. - * - * @return the maximumHops - */ - public Long maximumHops() { - return maximumHops; - } - - /** - * Gets the requestTimeout. - * - *

The maximum milliseconds to wait for a response from the web server. - * - * @return the requestTimeout - */ - public Long requestTimeout() { - return requestTimeout; - } - - /** - * Gets the overrideRobotsTxt. - * - *

When `true`, the crawler will ignore any `robots.txt` encountered by the crawler. This - * should only ever be done when crawling a web site the user owns. This must be be set to `true` - * when a **gateway_id** is specied in the **credentials**. - * - * @return the overrideRobotsTxt - */ - public Boolean overrideRobotsTxt() { - return overrideRobotsTxt; - } - - /** - * Gets the blacklist. - * - *

Array of URL's to be excluded while crawling. The crawler will not follow links which - * contains this string. For example, listing `https://ibm.com/watson` also excludes - * `https://ibm.com/watson/discovery`. - * - * @return the blacklist - */ - public List blacklist() { - return blacklist; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceSchedule.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceSchedule.java deleted file mode 100644 index dd2f36a7166..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceSchedule.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object containing the schedule information for the source. */ -public class SourceSchedule extends GenericModel { - - /** - * The crawl schedule in the specified **time_zone**. - * - *

- `five_minutes`: Runs every five minutes. - `hourly`: Runs every hour. - `daily`: Runs - * every day between 00:00 and 06:00. - `weekly`: Runs every week on Sunday between 00:00 and - * 06:00. - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. - */ - public interface Frequency { - /** daily. */ - String DAILY = "daily"; - /** weekly. */ - String WEEKLY = "weekly"; - /** monthly. */ - String MONTHLY = "monthly"; - /** five_minutes. */ - String FIVE_MINUTES = "five_minutes"; - /** hourly. */ - String HOURLY = "hourly"; - } - - protected Boolean enabled; - - @SerializedName("time_zone") - protected String timeZone; - - protected String frequency; - - /** Builder. */ - public static class Builder { - private Boolean enabled; - private String timeZone; - private String frequency; - - /** - * Instantiates a new Builder from an existing SourceSchedule instance. - * - * @param sourceSchedule the instance to initialize the Builder with - */ - private Builder(SourceSchedule sourceSchedule) { - this.enabled = sourceSchedule.enabled; - this.timeZone = sourceSchedule.timeZone; - this.frequency = sourceSchedule.frequency; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a SourceSchedule. - * - * @return the new SourceSchedule instance - */ - public SourceSchedule build() { - return new SourceSchedule(this); - } - - /** - * Set the enabled. - * - * @param enabled the enabled - * @return the SourceSchedule builder - */ - public Builder enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Set the timeZone. - * - * @param timeZone the timeZone - * @return the SourceSchedule builder - */ - public Builder timeZone(String timeZone) { - this.timeZone = timeZone; - return this; - } - - /** - * Set the frequency. - * - * @param frequency the frequency - * @return the SourceSchedule builder - */ - public Builder frequency(String frequency) { - this.frequency = frequency; - return this; - } - } - - protected SourceSchedule() {} - - protected SourceSchedule(Builder builder) { - enabled = builder.enabled; - timeZone = builder.timeZone; - frequency = builder.frequency; - } - - /** - * New builder. - * - * @return a SourceSchedule builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the enabled. - * - *

When `true`, the source is re-crawled based on the **frequency** field in this object. When - * `false` the source is not re-crawled; When `false` and connecting to Salesforce the source is - * crawled annually. - * - * @return the enabled - */ - public Boolean enabled() { - return enabled; - } - - /** - * Gets the timeZone. - * - *

The time zone to base source crawl times on. Possible values correspond to the IANA - * (Internet Assigned Numbers Authority) time zones list. - * - * @return the timeZone - */ - public String timeZone() { - return timeZone; - } - - /** - * Gets the frequency. - * - *

The crawl schedule in the specified **time_zone**. - * - *

- `five_minutes`: Runs every five minutes. - `hourly`: Runs every hour. - `daily`: Runs - * every day between 00:00 and 06:00. - `weekly`: Runs every week on Sunday between 00:00 and - * 06:00. - `monthly`: Runs the on the first Sunday of every month between 00:00 and 06:00. - * - * @return the frequency - */ - public String frequency() { - return frequency; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceStatus.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceStatus.java deleted file mode 100644 index 7ddef6ab624..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/SourceStatus.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** Object containing source crawl status information. */ -public class SourceStatus extends GenericModel { - - /** - * The current status of the source crawl for this collection. This field returns `not_configured` - * if the default configuration for this source does not have a **source** object defined. - * - *

- `running` indicates that a crawl to fetch more documents is in progress. - `complete` - * indicates that the crawl has completed with no errors. - `queued` indicates that the crawl has - * been paused by the system and will automatically restart when possible. - `unknown` indicates - * that an unidentified error has occured in the service. - */ - public interface Status { - /** running. */ - String RUNNING = "running"; - /** complete. */ - String COMPLETE = "complete"; - /** not_configured. */ - String NOT_CONFIGURED = "not_configured"; - /** queued. */ - String QUEUED = "queued"; - /** unknown. */ - String UNKNOWN = "unknown"; - } - - protected String status; - - @SerializedName("next_crawl") - protected Date nextCrawl; - - protected SourceStatus() {} - - /** - * Gets the status. - * - *

The current status of the source crawl for this collection. This field returns - * `not_configured` if the default configuration for this source does not have a **source** object - * defined. - * - *

- `running` indicates that a crawl to fetch more documents is in progress. - `complete` - * indicates that the crawl has completed with no errors. - `queued` indicates that the crawl has - * been paused by the system and will automatically restart when possible. - `unknown` indicates - * that an unidentified error has occured in the service. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the nextCrawl. - * - *

Date in `RFC 3339` format indicating the time of the next crawl attempt. - * - * @return the nextCrawl - */ - public Date getNextCrawl() { - return nextCrawl; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/StatusDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/StatusDetails.java deleted file mode 100644 index 9dd5ad57020..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/StatusDetails.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object that contains details about the status of the authentication process. */ -public class StatusDetails extends GenericModel { - - protected Boolean authenticated; - - @SerializedName("error_message") - protected String errorMessage; - - /** Builder. */ - public static class Builder { - private Boolean authenticated; - private String errorMessage; - - /** - * Instantiates a new Builder from an existing StatusDetails instance. - * - * @param statusDetails the instance to initialize the Builder with - */ - private Builder(StatusDetails statusDetails) { - this.authenticated = statusDetails.authenticated; - this.errorMessage = statusDetails.errorMessage; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a StatusDetails. - * - * @return the new StatusDetails instance - */ - public StatusDetails build() { - return new StatusDetails(this); - } - - /** - * Set the authenticated. - * - * @param authenticated the authenticated - * @return the StatusDetails builder - */ - public Builder authenticated(Boolean authenticated) { - this.authenticated = authenticated; - return this; - } - - /** - * Set the errorMessage. - * - * @param errorMessage the errorMessage - * @return the StatusDetails builder - */ - public Builder errorMessage(String errorMessage) { - this.errorMessage = errorMessage; - return this; - } - } - - protected StatusDetails() {} - - protected StatusDetails(Builder builder) { - authenticated = builder.authenticated; - errorMessage = builder.errorMessage; - } - - /** - * New builder. - * - * @return a StatusDetails builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the authenticated. - * - *

Indicates whether the credential is accepted by the target data source. - * - * @return the authenticated - */ - public Boolean authenticated() { - return authenticated; - } - - /** - * Gets the errorMessage. - * - *

If `authenticated` is `false`, a message describes why authentication is unsuccessful. - * - * @return the errorMessage - */ - public String errorMessage() { - return errorMessage; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TokenDictRule.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TokenDictRule.java deleted file mode 100644 index 0533d82f96c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TokenDictRule.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** An object defining a single tokenizaion rule. */ -public class TokenDictRule extends GenericModel { - - protected String text; - protected List tokens; - protected List readings; - - @SerializedName("part_of_speech") - protected String partOfSpeech; - - /** Builder. */ - public static class Builder { - private String text; - private List tokens; - private List readings; - private String partOfSpeech; - - /** - * Instantiates a new Builder from an existing TokenDictRule instance. - * - * @param tokenDictRule the instance to initialize the Builder with - */ - private Builder(TokenDictRule tokenDictRule) { - this.text = tokenDictRule.text; - this.tokens = tokenDictRule.tokens; - this.readings = tokenDictRule.readings; - this.partOfSpeech = tokenDictRule.partOfSpeech; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param text the text - * @param tokens the tokens - * @param partOfSpeech the partOfSpeech - */ - public Builder(String text, List tokens, String partOfSpeech) { - this.text = text; - this.tokens = tokens; - this.partOfSpeech = partOfSpeech; - } - - /** - * Builds a TokenDictRule. - * - * @return the new TokenDictRule instance - */ - public TokenDictRule build() { - return new TokenDictRule(this); - } - - /** - * Adds a new element to tokens. - * - * @param tokens the new element to be added - * @return the TokenDictRule builder - */ - public Builder addTokens(String tokens) { - com.ibm.cloud.sdk.core.util.Validator.notNull(tokens, "tokens cannot be null"); - if (this.tokens == null) { - this.tokens = new ArrayList(); - } - this.tokens.add(tokens); - return this; - } - - /** - * Adds a new element to readings. - * - * @param readings the new element to be added - * @return the TokenDictRule builder - */ - public Builder addReadings(String readings) { - com.ibm.cloud.sdk.core.util.Validator.notNull(readings, "readings cannot be null"); - if (this.readings == null) { - this.readings = new ArrayList(); - } - this.readings.add(readings); - return this; - } - - /** - * Set the text. - * - * @param text the text - * @return the TokenDictRule builder - */ - public Builder text(String text) { - this.text = text; - return this; - } - - /** - * Set the tokens. Existing tokens will be replaced. - * - * @param tokens the tokens - * @return the TokenDictRule builder - */ - public Builder tokens(List tokens) { - this.tokens = tokens; - return this; - } - - /** - * Set the readings. Existing readings will be replaced. - * - * @param readings the readings - * @return the TokenDictRule builder - */ - public Builder readings(List readings) { - this.readings = readings; - return this; - } - - /** - * Set the partOfSpeech. - * - * @param partOfSpeech the partOfSpeech - * @return the TokenDictRule builder - */ - public Builder partOfSpeech(String partOfSpeech) { - this.partOfSpeech = partOfSpeech; - return this; - } - } - - protected TokenDictRule() {} - - protected TokenDictRule(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.text, "text cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.tokens, "tokens cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.partOfSpeech, "partOfSpeech cannot be null"); - text = builder.text; - tokens = builder.tokens; - readings = builder.readings; - partOfSpeech = builder.partOfSpeech; - } - - /** - * New builder. - * - * @return a TokenDictRule builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the text. - * - *

The string to tokenize. - * - * @return the text - */ - public String text() { - return text; - } - - /** - * Gets the tokens. - * - *

Array of tokens that the `text` field is split into when found. - * - * @return the tokens - */ - public List tokens() { - return tokens; - } - - /** - * Gets the readings. - * - *

Array of tokens that represent the content of the `text` field in an alternate character - * set. - * - * @return the readings - */ - public List readings() { - return readings; - } - - /** - * Gets the partOfSpeech. - * - *

The part of speech that the `text` string belongs to. For example `noun`. Custom parts of - * speech can be specified. - * - * @return the partOfSpeech - */ - public String partOfSpeech() { - return partOfSpeech; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TokenDictStatusResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TokenDictStatusResponse.java deleted file mode 100644 index e9748708582..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TokenDictStatusResponse.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Object describing the current status of the wordlist. */ -public class TokenDictStatusResponse extends GenericModel { - - /** Current wordlist status for the specified collection. */ - public interface Status { - /** active. */ - String ACTIVE = "active"; - /** pending. */ - String PENDING = "pending"; - /** not found. */ - String NOT_FOUND = "not found"; - } - - protected String status; - protected String type; - - protected TokenDictStatusResponse() {} - - /** - * Gets the status. - * - *

Current wordlist status for the specified collection. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the type. - * - *

The type for this wordlist. Can be `tokenization_dictionary` or `stopwords`. - * - * @return the type - */ - public String getType() { - return type; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TopHitsResults.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TopHitsResults.java deleted file mode 100644 index 4f3147d3cfa..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TopHitsResults.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Top hit information for this query. */ -public class TopHitsResults extends GenericModel { - - @SerializedName("matching_results") - protected Long matchingResults; - - protected List hits; - - /** - * Gets the matchingResults. - * - *

Number of matching results. - * - * @return the matchingResults - */ - public Long getMatchingResults() { - return matchingResults; - } - - /** - * Gets the hits. - * - *

Top results returned by the aggregation. - * - * @return the hits - */ - public List getHits() { - return hits; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingDataSet.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingDataSet.java deleted file mode 100644 index 65b9f94e15f..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingDataSet.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Training information for a specific collection. */ -public class TrainingDataSet extends GenericModel { - - @SerializedName("environment_id") - protected String environmentId; - - @SerializedName("collection_id") - protected String collectionId; - - protected List queries; - - protected TrainingDataSet() {} - - /** - * Gets the environmentId. - * - *

The environment id associated with this training data set. - * - * @return the environmentId - */ - public String getEnvironmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The collection id associated with this training data set. - * - * @return the collectionId - */ - public String getCollectionId() { - return collectionId; - } - - /** - * Gets the queries. - * - *

Array of training queries. At least 50 queries are required for training to begin. A maximum - * of 10,000 queries are returned. - * - * @return the queries - */ - public List getQueries() { - return queries; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingExample.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingExample.java deleted file mode 100644 index 1de799911c3..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingExample.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Training example details. */ -public class TrainingExample extends GenericModel { - - @SerializedName("document_id") - protected String documentId; - - @SerializedName("cross_reference") - protected String crossReference; - - protected Long relevance; - - /** Builder. */ - public static class Builder { - private String documentId; - private String crossReference; - private Long relevance; - - /** - * Instantiates a new Builder from an existing TrainingExample instance. - * - * @param trainingExample the instance to initialize the Builder with - */ - private Builder(TrainingExample trainingExample) { - this.documentId = trainingExample.documentId; - this.crossReference = trainingExample.crossReference; - this.relevance = trainingExample.relevance; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a TrainingExample. - * - * @return the new TrainingExample instance - */ - public TrainingExample build() { - return new TrainingExample(this); - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the TrainingExample builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - - /** - * Set the crossReference. - * - * @param crossReference the crossReference - * @return the TrainingExample builder - */ - public Builder crossReference(String crossReference) { - this.crossReference = crossReference; - return this; - } - - /** - * Set the relevance. - * - * @param relevance the relevance - * @return the TrainingExample builder - */ - public Builder relevance(long relevance) { - this.relevance = relevance; - return this; - } - } - - protected TrainingExample() {} - - protected TrainingExample(Builder builder) { - documentId = builder.documentId; - crossReference = builder.crossReference; - relevance = builder.relevance; - } - - /** - * New builder. - * - * @return a TrainingExample builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the documentId. - * - *

The document ID associated with this training example. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } - - /** - * Gets the crossReference. - * - *

The cross reference associated with this training example. - * - * @return the crossReference - */ - public String crossReference() { - return crossReference; - } - - /** - * Gets the relevance. - * - *

The relevance of the training example. - * - * @return the relevance - */ - public Long relevance() { - return relevance; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingExampleList.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingExampleList.java deleted file mode 100644 index c86eeebecf8..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingExampleList.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Object containing an array of training examples. */ -public class TrainingExampleList extends GenericModel { - - protected List examples; - - protected TrainingExampleList() {} - - /** - * Gets the examples. - * - *

Array of training examples. - * - * @return the examples - */ - public List getExamples() { - return examples; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingQuery.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingQuery.java deleted file mode 100644 index ec7c32e5ff3..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingQuery.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** Training query details. */ -public class TrainingQuery extends GenericModel { - - @SerializedName("query_id") - protected String queryId; - - @SerializedName("natural_language_query") - protected String naturalLanguageQuery; - - protected String filter; - protected List examples; - - protected TrainingQuery() {} - - /** - * Gets the queryId. - * - *

The query ID associated with the training query. - * - * @return the queryId - */ - public String getQueryId() { - return queryId; - } - - /** - * Gets the naturalLanguageQuery. - * - *

The natural text query for the training query. - * - * @return the naturalLanguageQuery - */ - public String getNaturalLanguageQuery() { - return naturalLanguageQuery; - } - - /** - * Gets the filter. - * - *

The filter used on the collection before the **natural_language_query** is applied. - * - * @return the filter - */ - public String getFilter() { - return filter; - } - - /** - * Gets the examples. - * - *

Array of training examples. - * - * @return the examples - */ - public List getExamples() { - return examples; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingStatus.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingStatus.java deleted file mode 100644 index ceea5c0f367..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/TrainingStatus.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** Training status details. */ -public class TrainingStatus extends GenericModel { - - @SerializedName("total_examples") - protected Long totalExamples; - - protected Boolean available; - protected Boolean processing; - - @SerializedName("minimum_queries_added") - protected Boolean minimumQueriesAdded; - - @SerializedName("minimum_examples_added") - protected Boolean minimumExamplesAdded; - - @SerializedName("sufficient_label_diversity") - protected Boolean sufficientLabelDiversity; - - protected Long notices; - - @SerializedName("successfully_trained") - protected Date successfullyTrained; - - @SerializedName("data_updated") - protected Date dataUpdated; - - protected TrainingStatus() {} - - /** - * Gets the totalExamples. - * - *

The total number of training examples uploaded to this collection. - * - * @return the totalExamples - */ - public Long getTotalExamples() { - return totalExamples; - } - - /** - * Gets the available. - * - *

When `true`, the collection has been successfully trained. - * - * @return the available - */ - public Boolean isAvailable() { - return available; - } - - /** - * Gets the processing. - * - *

When `true`, the collection is currently processing training. - * - * @return the processing - */ - public Boolean isProcessing() { - return processing; - } - - /** - * Gets the minimumQueriesAdded. - * - *

When `true`, the collection has a sufficent amount of queries added for training to occur. - * - * @return the minimumQueriesAdded - */ - public Boolean isMinimumQueriesAdded() { - return minimumQueriesAdded; - } - - /** - * Gets the minimumExamplesAdded. - * - *

When `true`, the collection has a sufficent amount of examples added for training to occur. - * - * @return the minimumExamplesAdded - */ - public Boolean isMinimumExamplesAdded() { - return minimumExamplesAdded; - } - - /** - * Gets the sufficientLabelDiversity. - * - *

When `true`, the collection has a sufficent amount of diversity in labeled results for - * training to occur. - * - * @return the sufficientLabelDiversity - */ - public Boolean isSufficientLabelDiversity() { - return sufficientLabelDiversity; - } - - /** - * Gets the notices. - * - *

The number of notices associated with this data set. - * - * @return the notices - */ - public Long getNotices() { - return notices; - } - - /** - * Gets the successfullyTrained. - * - *

The timestamp of when the collection was successfully trained. - * - * @return the successfullyTrained - */ - public Date getSuccessfullyTrained() { - return successfullyTrained; - } - - /** - * Gets the dataUpdated. - * - *

The timestamp of when the data was uploaded. - * - * @return the dataUpdated - */ - public Date getDataUpdated() { - return dataUpdated; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateCollectionOptions.java deleted file mode 100644 index 2f636c11bde..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateCollectionOptions.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The updateCollection options. */ -public class UpdateCollectionOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String name; - protected String description; - protected String configurationId; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String name; - private String description; - private String configurationId; - - /** - * Instantiates a new Builder from an existing UpdateCollectionOptions instance. - * - * @param updateCollectionOptions the instance to initialize the Builder with - */ - private Builder(UpdateCollectionOptions updateCollectionOptions) { - this.environmentId = updateCollectionOptions.environmentId; - this.collectionId = updateCollectionOptions.collectionId; - this.name = updateCollectionOptions.name; - this.description = updateCollectionOptions.description; - this.configurationId = updateCollectionOptions.configurationId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param name the name - */ - public Builder(String environmentId, String collectionId, String name) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.name = name; - } - - /** - * Builds a UpdateCollectionOptions. - * - * @return the new UpdateCollectionOptions instance - */ - public UpdateCollectionOptions build() { - return new UpdateCollectionOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the UpdateCollectionOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the UpdateCollectionOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the UpdateCollectionOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the UpdateCollectionOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the configurationId. - * - * @param configurationId the configurationId - * @return the UpdateCollectionOptions builder - */ - public Builder configurationId(String configurationId) { - this.configurationId = configurationId; - return this; - } - } - - protected UpdateCollectionOptions() {} - - protected UpdateCollectionOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - name = builder.name; - description = builder.description; - configurationId = builder.configurationId; - } - - /** - * New builder. - * - * @return a UpdateCollectionOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the name. - * - *

The name of the collection. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - *

A description of the collection. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the configurationId. - * - *

The ID of the configuration in which the collection is to be updated. - * - * @return the configurationId - */ - public String configurationId() { - return configurationId; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateConfigurationOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateConfigurationOptions.java deleted file mode 100644 index 93c343f47f6..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateConfigurationOptions.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The updateConfiguration options. */ -public class UpdateConfigurationOptions extends GenericModel { - - protected String environmentId; - protected String configurationId; - protected String name; - protected String description; - protected Conversions conversions; - protected List enrichments; - protected List normalizations; - protected Source source; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String configurationId; - private String name; - private String description; - private Conversions conversions; - private List enrichments; - private List normalizations; - private Source source; - - /** - * Instantiates a new Builder from an existing UpdateConfigurationOptions instance. - * - * @param updateConfigurationOptions the instance to initialize the Builder with - */ - private Builder(UpdateConfigurationOptions updateConfigurationOptions) { - this.environmentId = updateConfigurationOptions.environmentId; - this.configurationId = updateConfigurationOptions.configurationId; - this.name = updateConfigurationOptions.name; - this.description = updateConfigurationOptions.description; - this.conversions = updateConfigurationOptions.conversions; - this.enrichments = updateConfigurationOptions.enrichments; - this.normalizations = updateConfigurationOptions.normalizations; - this.source = updateConfigurationOptions.source; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param configurationId the configurationId - * @param name the name - */ - public Builder(String environmentId, String configurationId, String name) { - this.environmentId = environmentId; - this.configurationId = configurationId; - this.name = name; - } - - /** - * Builds a UpdateConfigurationOptions. - * - * @return the new UpdateConfigurationOptions instance - */ - public UpdateConfigurationOptions build() { - return new UpdateConfigurationOptions(this); - } - - /** - * Adds a new element to enrichments. - * - * @param enrichment the new element to be added - * @return the UpdateConfigurationOptions builder - */ - public Builder addEnrichment(Enrichment enrichment) { - com.ibm.cloud.sdk.core.util.Validator.notNull(enrichment, "enrichment cannot be null"); - if (this.enrichments == null) { - this.enrichments = new ArrayList(); - } - this.enrichments.add(enrichment); - return this; - } - - /** - * Adds a new element to normalizations. - * - * @param normalization the new element to be added - * @return the UpdateConfigurationOptions builder - */ - public Builder addNormalization(NormalizationOperation normalization) { - com.ibm.cloud.sdk.core.util.Validator.notNull(normalization, "normalization cannot be null"); - if (this.normalizations == null) { - this.normalizations = new ArrayList(); - } - this.normalizations.add(normalization); - return this; - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the UpdateConfigurationOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the configurationId. - * - * @param configurationId the configurationId - * @return the UpdateConfigurationOptions builder - */ - public Builder configurationId(String configurationId) { - this.configurationId = configurationId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the UpdateConfigurationOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the UpdateConfigurationOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the conversions. - * - * @param conversions the conversions - * @return the UpdateConfigurationOptions builder - */ - public Builder conversions(Conversions conversions) { - this.conversions = conversions; - return this; - } - - /** - * Set the enrichments. Existing enrichments will be replaced. - * - * @param enrichments the enrichments - * @return the UpdateConfigurationOptions builder - */ - public Builder enrichments(List enrichments) { - this.enrichments = enrichments; - return this; - } - - /** - * Set the normalizations. Existing normalizations will be replaced. - * - * @param normalizations the normalizations - * @return the UpdateConfigurationOptions builder - */ - public Builder normalizations(List normalizations) { - this.normalizations = normalizations; - return this; - } - - /** - * Set the source. - * - * @param source the source - * @return the UpdateConfigurationOptions builder - */ - public Builder source(Source source) { - this.source = source; - return this; - } - - /** - * Set the configuration. - * - * @param configuration the configuration - * @return the UpdateConfigurationOptions builder - */ - public Builder configuration(Configuration configuration) { - this.name = configuration.name(); - this.description = configuration.description(); - this.conversions = configuration.conversions(); - this.enrichments = configuration.enrichments(); - this.normalizations = configuration.normalizations(); - this.source = configuration.source(); - return this; - } - } - - protected UpdateConfigurationOptions() {} - - protected UpdateConfigurationOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.configurationId, "configurationId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.name, "name cannot be null"); - environmentId = builder.environmentId; - configurationId = builder.configurationId; - name = builder.name; - description = builder.description; - conversions = builder.conversions; - enrichments = builder.enrichments; - normalizations = builder.normalizations; - source = builder.source; - } - - /** - * New builder. - * - * @return a UpdateConfigurationOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the configurationId. - * - *

The ID of the configuration. - * - * @return the configurationId - */ - public String configurationId() { - return configurationId; - } - - /** - * Gets the name. - * - *

The name of the configuration. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - *

The description of the configuration, if available. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the conversions. - * - *

Document conversion settings. - * - * @return the conversions - */ - public Conversions conversions() { - return conversions; - } - - /** - * Gets the enrichments. - * - *

An array of document enrichment settings for the configuration. - * - * @return the enrichments - */ - public List enrichments() { - return enrichments; - } - - /** - * Gets the normalizations. - * - *

Defines operations that can be used to transform the final output JSON into a normalized - * form. Operations are executed in the order that they appear in the array. - * - * @return the normalizations - */ - public List normalizations() { - return normalizations; - } - - /** - * Gets the source. - * - *

Object containing source parameters for the configuration. - * - * @return the source - */ - public Source source() { - return source; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptions.java deleted file mode 100644 index 02c906333e4..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptions.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The updateCredentials options. */ -public class UpdateCredentialsOptions extends GenericModel { - - /** - * The source that this credentials object connects to. - `box` indicates the credentials are used - * to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are used to - * connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to - * Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web - * crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud - * Object Store. - */ - public interface SourceType { - /** box. */ - String BOX = "box"; - /** salesforce. */ - String SALESFORCE = "salesforce"; - /** sharepoint. */ - String SHAREPOINT = "sharepoint"; - /** web_crawl. */ - String WEB_CRAWL = "web_crawl"; - /** cloud_object_storage. */ - String CLOUD_OBJECT_STORAGE = "cloud_object_storage"; - } - - protected String environmentId; - protected String credentialId; - protected String sourceType; - protected CredentialDetails credentialDetails; - protected StatusDetails status; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String credentialId; - private String sourceType; - private CredentialDetails credentialDetails; - private StatusDetails status; - - /** - * Instantiates a new Builder from an existing UpdateCredentialsOptions instance. - * - * @param updateCredentialsOptions the instance to initialize the Builder with - */ - private Builder(UpdateCredentialsOptions updateCredentialsOptions) { - this.environmentId = updateCredentialsOptions.environmentId; - this.credentialId = updateCredentialsOptions.credentialId; - this.sourceType = updateCredentialsOptions.sourceType; - this.credentialDetails = updateCredentialsOptions.credentialDetails; - this.status = updateCredentialsOptions.status; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param credentialId the credentialId - */ - public Builder(String environmentId, String credentialId) { - this.environmentId = environmentId; - this.credentialId = credentialId; - } - - /** - * Builds a UpdateCredentialsOptions. - * - * @return the new UpdateCredentialsOptions instance - */ - public UpdateCredentialsOptions build() { - return new UpdateCredentialsOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the UpdateCredentialsOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the credentialId. - * - * @param credentialId the credentialId - * @return the UpdateCredentialsOptions builder - */ - public Builder credentialId(String credentialId) { - this.credentialId = credentialId; - return this; - } - - /** - * Set the sourceType. - * - * @param sourceType the sourceType - * @return the UpdateCredentialsOptions builder - */ - public Builder sourceType(String sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * Set the credentialDetails. - * - * @param credentialDetails the credentialDetails - * @return the UpdateCredentialsOptions builder - */ - public Builder credentialDetails(CredentialDetails credentialDetails) { - this.credentialDetails = credentialDetails; - return this; - } - - /** - * Set the status. - * - * @param status the status - * @return the UpdateCredentialsOptions builder - */ - public Builder status(StatusDetails status) { - this.status = status; - return this; - } - - /** - * Set the credentials. - * - * @param credentials the credentials - * @return the UpdateCredentialsOptions builder - */ - public Builder credentials(Credentials credentials) { - this.sourceType = credentials.sourceType(); - this.credentialDetails = credentials.credentialDetails(); - this.status = credentials.status(); - return this; - } - } - - protected UpdateCredentialsOptions() {} - - protected UpdateCredentialsOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.credentialId, "credentialId cannot be empty"); - environmentId = builder.environmentId; - credentialId = builder.credentialId; - sourceType = builder.sourceType; - credentialDetails = builder.credentialDetails; - status = builder.status; - } - - /** - * New builder. - * - * @return a UpdateCredentialsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the credentialId. - * - *

The unique identifier for a set of source credentials. - * - * @return the credentialId - */ - public String credentialId() { - return credentialId; - } - - /** - * Gets the sourceType. - * - *

The source that this credentials object connects to. - `box` indicates the credentials are - * used to connect an instance of Enterprise Box. - `salesforce` indicates the credentials are - * used to connect to Salesforce. - `sharepoint` indicates the credentials are used to connect to - * Microsoft SharePoint Online. - `web_crawl` indicates the credentials are used to perform a web - * crawl. = `cloud_object_storage` indicates the credentials are used to connect to an IBM Cloud - * Object Store. - * - * @return the sourceType - */ - public String sourceType() { - return sourceType; - } - - /** - * Gets the credentialDetails. - * - *

Object containing details of the stored credentials. - * - *

Obtain credentials for your source from the administrator of the source. - * - * @return the credentialDetails - */ - public CredentialDetails credentialDetails() { - return credentialDetails; - } - - /** - * Gets the status. - * - *

Object that contains details about the status of the authentication process. - * - * @return the status - */ - public StatusDetails status() { - return status; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateDocumentOptions.java deleted file mode 100644 index e6bda70ece7..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateDocumentOptions.java +++ /dev/null @@ -1,283 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -/** The updateDocument options. */ -public class UpdateDocumentOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String documentId; - protected InputStream file; - protected String filename; - protected String fileContentType; - protected String metadata; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String documentId; - private InputStream file; - private String filename; - private String fileContentType; - private String metadata; - - /** - * Instantiates a new Builder from an existing UpdateDocumentOptions instance. - * - * @param updateDocumentOptions the instance to initialize the Builder with - */ - private Builder(UpdateDocumentOptions updateDocumentOptions) { - this.environmentId = updateDocumentOptions.environmentId; - this.collectionId = updateDocumentOptions.collectionId; - this.documentId = updateDocumentOptions.documentId; - this.file = updateDocumentOptions.file; - this.filename = updateDocumentOptions.filename; - this.fileContentType = updateDocumentOptions.fileContentType; - this.metadata = updateDocumentOptions.metadata; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param documentId the documentId - */ - public Builder(String environmentId, String collectionId, String documentId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.documentId = documentId; - } - - /** - * Builds a UpdateDocumentOptions. - * - * @return the new UpdateDocumentOptions instance - */ - public UpdateDocumentOptions build() { - return new UpdateDocumentOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the UpdateDocumentOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the UpdateDocumentOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the UpdateDocumentOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - - /** - * Set the file. - * - * @param file the file - * @return the UpdateDocumentOptions builder - */ - public Builder file(InputStream file) { - this.file = file; - return this; - } - - /** - * Set the filename. - * - * @param filename the filename - * @return the UpdateDocumentOptions builder - */ - public Builder filename(String filename) { - this.filename = filename; - return this; - } - - /** - * Set the fileContentType. - * - * @param fileContentType the fileContentType - * @return the UpdateDocumentOptions builder - */ - public Builder fileContentType(String fileContentType) { - this.fileContentType = fileContentType; - return this; - } - - /** - * Set the metadata. - * - * @param metadata the metadata - * @return the UpdateDocumentOptions builder - */ - public Builder metadata(String metadata) { - this.metadata = metadata; - return this; - } - - /** - * Set the file. - * - * @param file the file - * @return the UpdateDocumentOptions builder - * @throws FileNotFoundException if the file could not be found - */ - public Builder file(File file) throws FileNotFoundException { - this.file = new FileInputStream(file); - this.filename = file.getName(); - return this; - } - } - - protected UpdateDocumentOptions() {} - - protected UpdateDocumentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.documentId, "documentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.isTrue( - (builder.file == null) || (builder.filename != null), - "filename cannot be null if file is not null."); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - documentId = builder.documentId; - file = builder.file; - filename = builder.filename; - fileContentType = builder.fileContentType; - metadata = builder.metadata; - } - - /** - * New builder. - * - * @return a UpdateDocumentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the documentId. - * - *

The ID of the document. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } - - /** - * Gets the file. - * - *

The content of the document to ingest. The maximum supported file size when adding a file to - * a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 - * megabyte. Files larger than the supported size are rejected. - * - * @return the file - */ - public InputStream file() { - return file; - } - - /** - * Gets the filename. - * - *

The filename for file. - * - * @return the filename - */ - public String filename() { - return filename; - } - - /** - * Gets the fileContentType. - * - *

The content type of file. Values for this parameter can be obtained from the HttpMediaType - * class. - * - * @return the fileContentType - */ - public String fileContentType() { - return fileContentType; - } - - /** - * Gets the metadata. - * - *

The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are - * rejected. Example: ``` { "Creator": "Johnny Appleseed", "Subject": "Apples" } ```. - * - * @return the metadata - */ - public String metadata() { - return metadata; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateEnvironmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateEnvironmentOptions.java deleted file mode 100644 index 930d02e74fa..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateEnvironmentOptions.java +++ /dev/null @@ -1,197 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The updateEnvironment options. */ -public class UpdateEnvironmentOptions extends GenericModel { - - /** - * Size to change the environment to. **Note:** Lite plan users cannot change the environment - * size. - */ - public interface Size { - /** S. */ - String S = "S"; - /** MS. */ - String MS = "MS"; - /** M. */ - String M = "M"; - /** ML. */ - String ML = "ML"; - /** L. */ - String L = "L"; - /** XL. */ - String XL = "XL"; - /** XXL. */ - String XXL = "XXL"; - /** XXXL. */ - String XXXL = "XXXL"; - } - - protected String environmentId; - protected String name; - protected String description; - protected String size; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String name; - private String description; - private String size; - - /** - * Instantiates a new Builder from an existing UpdateEnvironmentOptions instance. - * - * @param updateEnvironmentOptions the instance to initialize the Builder with - */ - private Builder(UpdateEnvironmentOptions updateEnvironmentOptions) { - this.environmentId = updateEnvironmentOptions.environmentId; - this.name = updateEnvironmentOptions.name; - this.description = updateEnvironmentOptions.description; - this.size = updateEnvironmentOptions.size; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - */ - public Builder(String environmentId) { - this.environmentId = environmentId; - } - - /** - * Builds a UpdateEnvironmentOptions. - * - * @return the new UpdateEnvironmentOptions instance - */ - public UpdateEnvironmentOptions build() { - return new UpdateEnvironmentOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the UpdateEnvironmentOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the UpdateEnvironmentOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the description. - * - * @param description the description - * @return the UpdateEnvironmentOptions builder - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * Set the size. - * - * @param size the size - * @return the UpdateEnvironmentOptions builder - */ - public Builder size(String size) { - this.size = size; - return this; - } - } - - protected UpdateEnvironmentOptions() {} - - protected UpdateEnvironmentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - environmentId = builder.environmentId; - name = builder.name; - description = builder.description; - size = builder.size; - } - - /** - * New builder. - * - * @return a UpdateEnvironmentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the name. - * - *

Name that identifies the environment. - * - * @return the name - */ - public String name() { - return name; - } - - /** - * Gets the description. - * - *

Description of the environment. - * - * @return the description - */ - public String description() { - return description; - } - - /** - * Gets the size. - * - *

Size to change the environment to. **Note:** Lite plan users cannot change the environment - * size. - * - * @return the size - */ - public String size() { - return size; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateTrainingExampleOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateTrainingExampleOptions.java deleted file mode 100644 index a2f9d197b9c..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/UpdateTrainingExampleOptions.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The updateTrainingExample options. */ -public class UpdateTrainingExampleOptions extends GenericModel { - - protected String environmentId; - protected String collectionId; - protected String queryId; - protected String exampleId; - protected String crossReference; - protected Long relevance; - - /** Builder. */ - public static class Builder { - private String environmentId; - private String collectionId; - private String queryId; - private String exampleId; - private String crossReference; - private Long relevance; - - /** - * Instantiates a new Builder from an existing UpdateTrainingExampleOptions instance. - * - * @param updateTrainingExampleOptions the instance to initialize the Builder with - */ - private Builder(UpdateTrainingExampleOptions updateTrainingExampleOptions) { - this.environmentId = updateTrainingExampleOptions.environmentId; - this.collectionId = updateTrainingExampleOptions.collectionId; - this.queryId = updateTrainingExampleOptions.queryId; - this.exampleId = updateTrainingExampleOptions.exampleId; - this.crossReference = updateTrainingExampleOptions.crossReference; - this.relevance = updateTrainingExampleOptions.relevance; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param environmentId the environmentId - * @param collectionId the collectionId - * @param queryId the queryId - * @param exampleId the exampleId - */ - public Builder(String environmentId, String collectionId, String queryId, String exampleId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.queryId = queryId; - this.exampleId = exampleId; - } - - /** - * Builds a UpdateTrainingExampleOptions. - * - * @return the new UpdateTrainingExampleOptions instance - */ - public UpdateTrainingExampleOptions build() { - return new UpdateTrainingExampleOptions(this); - } - - /** - * Set the environmentId. - * - * @param environmentId the environmentId - * @return the UpdateTrainingExampleOptions builder - */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; - return this; - } - - /** - * Set the collectionId. - * - * @param collectionId the collectionId - * @return the UpdateTrainingExampleOptions builder - */ - public Builder collectionId(String collectionId) { - this.collectionId = collectionId; - return this; - } - - /** - * Set the queryId. - * - * @param queryId the queryId - * @return the UpdateTrainingExampleOptions builder - */ - public Builder queryId(String queryId) { - this.queryId = queryId; - return this; - } - - /** - * Set the exampleId. - * - * @param exampleId the exampleId - * @return the UpdateTrainingExampleOptions builder - */ - public Builder exampleId(String exampleId) { - this.exampleId = exampleId; - return this; - } - - /** - * Set the crossReference. - * - * @param crossReference the crossReference - * @return the UpdateTrainingExampleOptions builder - */ - public Builder crossReference(String crossReference) { - this.crossReference = crossReference; - return this; - } - - /** - * Set the relevance. - * - * @param relevance the relevance - * @return the UpdateTrainingExampleOptions builder - */ - public Builder relevance(long relevance) { - this.relevance = relevance; - return this; - } - } - - protected UpdateTrainingExampleOptions() {} - - protected UpdateTrainingExampleOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.collectionId, "collectionId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.queryId, "queryId cannot be empty"); - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.exampleId, "exampleId cannot be empty"); - environmentId = builder.environmentId; - collectionId = builder.collectionId; - queryId = builder.queryId; - exampleId = builder.exampleId; - crossReference = builder.crossReference; - relevance = builder.relevance; - } - - /** - * New builder. - * - * @return a UpdateTrainingExampleOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the environmentId. - * - *

The ID of the environment. - * - * @return the environmentId - */ - public String environmentId() { - return environmentId; - } - - /** - * Gets the collectionId. - * - *

The ID of the collection. - * - * @return the collectionId - */ - public String collectionId() { - return collectionId; - } - - /** - * Gets the queryId. - * - *

The ID of the query used for training. - * - * @return the queryId - */ - public String queryId() { - return queryId; - } - - /** - * Gets the exampleId. - * - *

The ID of the document as it is indexed. - * - * @return the exampleId - */ - public String exampleId() { - return exampleId; - } - - /** - * Gets the crossReference. - * - *

The example to add. - * - * @return the crossReference - */ - public String crossReference() { - return crossReference; - } - - /** - * Gets the relevance. - * - *

The relevance value for this example. - * - * @return the relevance - */ - public Long relevance() { - return relevance; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordHeadingDetection.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordHeadingDetection.java deleted file mode 100644 index bf3d38a458e..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordHeadingDetection.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** Object containing heading detection conversion settings for Microsoft Word documents. */ -public class WordHeadingDetection extends GenericModel { - - protected List fonts; - protected List styles; - - /** Builder. */ - public static class Builder { - private List fonts; - private List styles; - - /** - * Instantiates a new Builder from an existing WordHeadingDetection instance. - * - * @param wordHeadingDetection the instance to initialize the Builder with - */ - private Builder(WordHeadingDetection wordHeadingDetection) { - this.fonts = wordHeadingDetection.fonts; - this.styles = wordHeadingDetection.styles; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a WordHeadingDetection. - * - * @return the new WordHeadingDetection instance - */ - public WordHeadingDetection build() { - return new WordHeadingDetection(this); - } - - /** - * Adds a new element to fonts. - * - * @param fontSetting the new element to be added - * @return the WordHeadingDetection builder - */ - public Builder addFontSetting(FontSetting fontSetting) { - com.ibm.cloud.sdk.core.util.Validator.notNull(fontSetting, "fontSetting cannot be null"); - if (this.fonts == null) { - this.fonts = new ArrayList(); - } - this.fonts.add(fontSetting); - return this; - } - - /** - * Adds a new element to styles. - * - * @param wordStyle the new element to be added - * @return the WordHeadingDetection builder - */ - public Builder addWordStyle(WordStyle wordStyle) { - com.ibm.cloud.sdk.core.util.Validator.notNull(wordStyle, "wordStyle cannot be null"); - if (this.styles == null) { - this.styles = new ArrayList(); - } - this.styles.add(wordStyle); - return this; - } - - /** - * Set the fonts. Existing fonts will be replaced. - * - * @param fonts the fonts - * @return the WordHeadingDetection builder - */ - public Builder fonts(List fonts) { - this.fonts = fonts; - return this; - } - - /** - * Set the styles. Existing styles will be replaced. - * - * @param styles the styles - * @return the WordHeadingDetection builder - */ - public Builder styles(List styles) { - this.styles = styles; - return this; - } - } - - protected WordHeadingDetection() {} - - protected WordHeadingDetection(Builder builder) { - fonts = builder.fonts; - styles = builder.styles; - } - - /** - * New builder. - * - * @return a WordHeadingDetection builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the fonts. - * - *

Array of font matching configurations. - * - * @return the fonts - */ - public List fonts() { - return fonts; - } - - /** - * Gets the styles. - * - *

Array of Microsoft Word styles to convert. - * - * @return the styles - */ - public List styles() { - return styles; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordSettings.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordSettings.java deleted file mode 100644 index 858ae9a60cf..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordSettings.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** A list of Word conversion settings. */ -public class WordSettings extends GenericModel { - - protected WordHeadingDetection heading; - - /** Builder. */ - public static class Builder { - private WordHeadingDetection heading; - - /** - * Instantiates a new Builder from an existing WordSettings instance. - * - * @param wordSettings the instance to initialize the Builder with - */ - private Builder(WordSettings wordSettings) { - this.heading = wordSettings.heading; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a WordSettings. - * - * @return the new WordSettings instance - */ - public WordSettings build() { - return new WordSettings(this); - } - - /** - * Set the heading. - * - * @param heading the heading - * @return the WordSettings builder - */ - public Builder heading(WordHeadingDetection heading) { - this.heading = heading; - return this; - } - } - - protected WordSettings() {} - - protected WordSettings(Builder builder) { - heading = builder.heading; - } - - /** - * New builder. - * - * @return a WordSettings builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the heading. - * - *

Object containing heading detection conversion settings for Microsoft Word documents. - * - * @return the heading - */ - public WordHeadingDetection heading() { - return heading; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordStyle.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordStyle.java deleted file mode 100644 index 64994622932..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/WordStyle.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** Microsoft Word styles to convert into a specified HTML head level. */ -public class WordStyle extends GenericModel { - - protected Long level; - protected List names; - - /** Builder. */ - public static class Builder { - private Long level; - private List names; - - /** - * Instantiates a new Builder from an existing WordStyle instance. - * - * @param wordStyle the instance to initialize the Builder with - */ - private Builder(WordStyle wordStyle) { - this.level = wordStyle.level; - this.names = wordStyle.names; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a WordStyle. - * - * @return the new WordStyle instance - */ - public WordStyle build() { - return new WordStyle(this); - } - - /** - * Adds a new element to names. - * - * @param names the new element to be added - * @return the WordStyle builder - */ - public Builder addNames(String names) { - com.ibm.cloud.sdk.core.util.Validator.notNull(names, "names cannot be null"); - if (this.names == null) { - this.names = new ArrayList(); - } - this.names.add(names); - return this; - } - - /** - * Set the level. - * - * @param level the level - * @return the WordStyle builder - */ - public Builder level(long level) { - this.level = level; - return this; - } - - /** - * Set the names. Existing names will be replaced. - * - * @param names the names - * @return the WordStyle builder - */ - public Builder names(List names) { - this.names = names; - return this; - } - } - - protected WordStyle() {} - - protected WordStyle(Builder builder) { - level = builder.level; - names = builder.names; - } - - /** - * New builder. - * - * @return a WordStyle builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the level. - * - *

HTML head level that content matching this style is tagged with. - * - * @return the level - */ - public Long level() { - return level; - } - - /** - * Gets the names. - * - *

Array of word style names to convert. - * - * @return the names - */ - public List names() { - return names; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/XPathPatterns.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/model/XPathPatterns.java deleted file mode 100644 index af4b0b123eb..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/XPathPatterns.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** Object containing an array of XPaths. */ -public class XPathPatterns extends GenericModel { - - protected List xpaths; - - /** Builder. */ - public static class Builder { - private List xpaths; - - /** - * Instantiates a new Builder from an existing XPathPatterns instance. - * - * @param xPathPatterns the instance to initialize the Builder with - */ - private Builder(XPathPatterns xPathPatterns) { - this.xpaths = xPathPatterns.xpaths; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a XPathPatterns. - * - * @return the new XPathPatterns instance - */ - public XPathPatterns build() { - return new XPathPatterns(this); - } - - /** - * Adds a new element to xpaths. - * - * @param xpaths the new element to be added - * @return the XPathPatterns builder - */ - public Builder addXpaths(String xpaths) { - com.ibm.cloud.sdk.core.util.Validator.notNull(xpaths, "xpaths cannot be null"); - if (this.xpaths == null) { - this.xpaths = new ArrayList(); - } - this.xpaths.add(xpaths); - return this; - } - - /** - * Set the xpaths. Existing xpaths will be replaced. - * - * @param xpaths the xpaths - * @return the XPathPatterns builder - */ - public Builder xpaths(List xpaths) { - this.xpaths = xpaths; - return this; - } - } - - protected XPathPatterns() {} - - protected XPathPatterns(Builder builder) { - xpaths = builder.xpaths; - } - - /** - * New builder. - * - * @return a XPathPatterns builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the xpaths. - * - *

An array to XPaths. - * - * @return the xpaths - */ - public List xpaths() { - return xpaths; - } -} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/package-info.java b/discovery/src/main/java/com/ibm/watson/discovery/v1/package-info.java deleted file mode 100644 index 7918da3fedc..00000000000 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/package-info.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -/** Discovery v1. */ -package com.ibm.watson.discovery.v1; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/Discovery.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/Discovery.java index e341cfe8e21..d5b518523fb 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/Discovery.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/Discovery.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 + * IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 */ package com.ibm.watson.discovery.v2; @@ -72,6 +72,8 @@ import com.ibm.watson.discovery.v2.model.GetProjectOptions; import com.ibm.watson.discovery.v2.model.GetStopwordListOptions; import com.ibm.watson.discovery.v2.model.GetTrainingQueryOptions; +import com.ibm.watson.discovery.v2.model.ListBatchesOptions; +import com.ibm.watson.discovery.v2.model.ListBatchesResponse; import com.ibm.watson.discovery.v2.model.ListCollectionsOptions; import com.ibm.watson.discovery.v2.model.ListCollectionsResponse; import com.ibm.watson.discovery.v2.model.ListDocumentClassifierModelsOptions; @@ -86,6 +88,9 @@ import com.ibm.watson.discovery.v2.model.ListProjectsResponse; import com.ibm.watson.discovery.v2.model.ListTrainingQueriesOptions; import com.ibm.watson.discovery.v2.model.ProjectDetails; +import com.ibm.watson.discovery.v2.model.PullBatchesOptions; +import com.ibm.watson.discovery.v2.model.PullBatchesResponse; +import com.ibm.watson.discovery.v2.model.PushBatchesOptions; import com.ibm.watson.discovery.v2.model.QueryCollectionNoticesOptions; import com.ibm.watson.discovery.v2.model.QueryNoticesOptions; import com.ibm.watson.discovery.v2.model.QueryNoticesResponse; @@ -1794,6 +1799,129 @@ public ServiceCall deleteEnrichment(DeleteEnrichmentOptions deleteEnrichme return createServiceCall(builder.build(), responseConverter); } + /** + * List batches. + * + *

A batch is a set of documents that are ready for enrichment by an external application. + * After you apply a webhook enrichment to a collection, and then process or upload documents to + * the collection, Discovery creates a batch with a unique **batch_id**. + * + *

To start, you must register your external application as a **webhook** type by using the + * [Create enrichment API](/apidocs/discovery-data#createenrichment) method. + * + *

Use the List batches API to get the following: + * + *

* Notified batches that are not yet pulled by the external enrichment application. + * + *

* Batches that are pulled, but not yet pushed to Discovery by the external enrichment + * application. + * + * @param listBatchesOptions the {@link ListBatchesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link ListBatchesResponse} + */ + public ServiceCall listBatches(ListBatchesOptions listBatchesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + listBatchesOptions, "listBatchesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("project_id", listBatchesOptions.projectId()); + pathParamsMap.put("collection_id", listBatchesOptions.collectionId()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/projects/{project_id}/collections/{collection_id}/batches", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v2", "listBatches"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Pull batches. + * + *

Pull a batch of documents from Discovery for enrichment by an external application. Ensure + * to include the `Accept-Encoding: gzip` header in this method to get the file. You can also + * implement retry logic when calling this method to avoid any network errors. + * + * @param pullBatchesOptions the {@link PullBatchesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link PullBatchesResponse} + */ + public ServiceCall pullBatches(PullBatchesOptions pullBatchesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + pullBatchesOptions, "pullBatchesOptions cannot be null"); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("project_id", pullBatchesOptions.projectId()); + pathParamsMap.put("collection_id", pullBatchesOptions.collectionId()); + pathParamsMap.put("batch_id", pullBatchesOptions.batchId()); + RequestBuilder builder = + RequestBuilder.get( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/projects/{project_id}/collections/{collection_id}/batches/{batch_id}", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v2", "pullBatches"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + + /** + * Push batches. + * + *

Push a batch of documents to Discovery after annotation by an external application. You can + * implement retry logic when calling this method to avoid any network errors. + * + * @param pushBatchesOptions the {@link PushBatchesOptions} containing the options for the call + * @return a {@link ServiceCall} with a result of type {@link Boolean} + */ + public ServiceCall pushBatches(PushBatchesOptions pushBatchesOptions) { + com.ibm.cloud.sdk.core.util.Validator.notNull( + pushBatchesOptions, "pushBatchesOptions cannot be null"); + com.ibm.cloud.sdk.core.util.Validator.isTrue( + (pushBatchesOptions.file() != null), "At least one of or file must be supplied."); + Map pathParamsMap = new HashMap(); + pathParamsMap.put("project_id", pushBatchesOptions.projectId()); + pathParamsMap.put("collection_id", pushBatchesOptions.collectionId()); + pathParamsMap.put("batch_id", pushBatchesOptions.batchId()); + RequestBuilder builder = + RequestBuilder.post( + RequestBuilder.resolveRequestUrl( + getServiceUrl(), + "/v2/projects/{project_id}/collections/{collection_id}/batches/{batch_id}", + pathParamsMap)); + Map sdkHeaders = SdkCommon.getSdkHeaders("discovery", "v2", "pushBatches"); + for (Entry header : sdkHeaders.entrySet()) { + builder.header(header.getKey(), header.getValue()); + } + builder.header("Accept", "application/json"); + builder.query("version", String.valueOf(this.version)); + MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); + multipartBuilder.setType(MultipartBody.FORM); + if (pushBatchesOptions.file() != null) { + okhttp3.RequestBody fileBody = + RequestUtils.inputStreamBody(pushBatchesOptions.file(), "application/octet-stream"); + multipartBuilder.addFormDataPart("file", pushBatchesOptions.filename(), fileBody); + } + builder.body(multipartBuilder.build()); + ResponseConverter responseConverter = + ResponseConverterUtils.getValue( + new com.google.gson.reflect.TypeToken() {}.getType()); + return createServiceCall(builder.build(), responseConverter); + } + /** * List document classifiers. * diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AddDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AddDocumentOptions.java index dc9d9ddf124..82086ad0529 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AddDocumentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AddDocumentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzeDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzeDocumentOptions.java index 1b7c1034b1b..afcb38314b6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzeDocumentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzeDocumentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedDocument.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedDocument.java index 842a4434a5a..4521bf9b87e 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedDocument.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedDocument.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedResult.java index 4f21965dc91..b3fa0c2a062 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/AnalyzedResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2022. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; @@ -17,7 +18,11 @@ import com.ibm.cloud.sdk.core.service.model.DynamicModel; import java.util.Map; -/** Result of the document analysis. */ +/** + * Result of the document analysis. + * + *

This type supports additional properties of type Object. The remaining key-value pairs. + */ public class AnalyzedResult extends DynamicModel { @SerializedName("metadata") diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/BatchDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/BatchDetails.java new file mode 100644 index 00000000000..a193a9b4fb9 --- /dev/null +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/BatchDetails.java @@ -0,0 +1,69 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.discovery.v2.model; + +import com.google.gson.annotations.SerializedName; +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.util.Date; + +/** + * A batch is a set of documents that are ready for enrichment by an external application. After you + * apply a webhook enrichment to a collection, and then process or upload documents to the + * collection, Discovery creates a batch with a unique **batch_id**. + */ +public class BatchDetails extends GenericModel { + + @SerializedName("batch_id") + protected String batchId; + + protected Date created; + + @SerializedName("enrichment_id") + protected String enrichmentId; + + protected BatchDetails() {} + + /** + * Gets the batchId. + * + *

The Universally Unique Identifier (UUID) for a batch of documents. + * + * @return the batchId + */ + public String getBatchId() { + return batchId; + } + + /** + * Gets the created. + * + *

The date and time (RFC3339) that the batch was created. + * + * @return the created + */ + public Date getCreated() { + return created; + } + + /** + * Gets the enrichmentId. + * + *

The Universally Unique Identifier (UUID) for the external enrichment. + * + * @return the enrichmentId + */ + public String getEnrichmentId() { + return enrichmentId; + } +} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierFederatedModel.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierFederatedModel.java index a23d28ee0f9..453556352cd 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierFederatedModel.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierFederatedModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierModelEvaluation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierModelEvaluation.java index 295249cb705..7ac681b28f7 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierModelEvaluation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ClassifierModelEvaluation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Collection.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Collection.java index f882dcff71e..e437c863f71 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Collection.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Collection.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetails.java index ecb4e67c7cd..a3a7936f907 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetails.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetails.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetailsSmartDocumentUnderstanding.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetailsSmartDocumentUnderstanding.java index fad1bf4bf80..41b497b4158 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetailsSmartDocumentUnderstanding.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionDetailsSmartDocumentUnderstanding.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionEnrichment.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionEnrichment.java index fed974be1ff..d7ec6be5a9f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionEnrichment.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CollectionEnrichment.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Completions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Completions.java index 5cd24086e98..0e1594f5989 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Completions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Completions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsAggregation.java index d1495035ae7..02b08751108 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShown.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShown.java index 927c39dc94c..ffda748e931 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShown.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShown.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownBody.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownBody.java index f1901e42232..b9378decc55 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownBody.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownBody.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownTitle.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownTitle.java index c77a859f346..5a682eaca6d 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownTitle.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsFieldsShownTitle.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsResponse.java index 432f8290ae0..420e7c446a2 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ComponentSettingsResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateCollectionOptions.java index 2639f8ce8d7..534b99a2646 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateCollectionOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateCollectionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifier.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifier.java index e9640b42a56..73da104b1d3 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifier.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifier.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierModelOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierModelOptions.java index b587cb5378e..ee89ce5dc80 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierModelOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierOptions.java index 772c69d76e5..92b28a99d65 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateDocumentClassifierOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichment.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichment.java index 2aa0f32359e..be014028089 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichment.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichment.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -44,9 +45,7 @@ public class CreateEnrichment extends GenericModel { *

* `watson_knowledge_studio_model`: Creates an enrichment from a Watson Knowledge Studio * machine learning model that is defined in a ZIP file. * - *

* `webhook`: Connects to an external enrichment application by using a webhook. The feature - * is available from IBM Cloud-managed instances only. The external enrichment feature is beta - * functionality. Beta features are not supported by the SDKs. + *

* `webhook`: Connects to an external enrichment application by using a webhook. * *

* `sentence_classifier`: Use sentence classifier to classify sentences in your documents. * This feature is available in IBM Cloud-managed instances only. The sentence classifier feature @@ -221,9 +220,7 @@ public String description() { *

* `watson_knowledge_studio_model`: Creates an enrichment from a Watson Knowledge Studio * machine learning model that is defined in a ZIP file. * - *

* `webhook`: Connects to an external enrichment application by using a webhook. The feature - * is available from IBM Cloud-managed instances only. The external enrichment feature is beta - * functionality. Beta features are not supported by the SDKs. + *

* `webhook`: Connects to an external enrichment application by using a webhook. * *

* `sentence_classifier`: Use sentence classifier to classify sentences in your documents. * This feature is available in IBM Cloud-managed instances only. The sentence classifier feature diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichmentOptions.java index c22a9d2df3c..976db595169 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichmentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateEnrichmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateExpansionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateExpansionsOptions.java index 2bcf88bd0df..83174d4842f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateExpansionsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateExpansionsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateProjectOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateProjectOptions.java index e3d18f6e3d5..b35a2a8f391 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateProjectOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateProjectOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateStopwordListOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateStopwordListOptions.java index 08c3fa467c6..0dd0b2009b7 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateStopwordListOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateStopwordListOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateTrainingQueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateTrainingQueryOptions.java index 1d090d92479..92ee165a1a5 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateTrainingQueryOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/CreateTrainingQueryOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParams.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParams.java index b5c4a6ee78d..fe478dd98a9 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParams.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParams.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsPassages.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsPassages.java index 84b634409e9..806a5a782e6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsPassages.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsPassages.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsSuggestedRefinements.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsSuggestedRefinements.java index 3f54d754311..955824fffeb 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsSuggestedRefinements.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsSuggestedRefinements.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsTableResults.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsTableResults.java index 16180c02c3b..30e48c9cf6c 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsTableResults.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DefaultQueryParamsTableResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteCollectionOptions.java index 4314ad8a7a4..b3bfcb785a6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteCollectionOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteCollectionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierModelOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierModelOptions.java index 94248906d0d..39a6887050e 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierModelOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierOptions.java index 5054ec81851..f5f5ff19fa5 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentClassifierOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentOptions.java index c09bcda6b61..c4b6dc0380a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentResponse.java index 665dfd67dd2..dc658ceb97e 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteDocumentResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteEnrichmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteEnrichmentOptions.java index e444d62241d..2173a907a5e 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteEnrichmentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteEnrichmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteExpansionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteExpansionsOptions.java index be0c9ff50e0..c9fd4638d12 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteExpansionsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteExpansionsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteProjectOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteProjectOptions.java index fb8559bb000..d108f655ff6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteProjectOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteProjectOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteStopwordListOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteStopwordListOptions.java index e23d5cf3b97..ffe8b80813b 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteStopwordListOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteStopwordListOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueriesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueriesOptions.java index 72602016fbb..a7c9d4098e0 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueriesOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueriesOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueryOptions.java index 6e8c45ec59a..56574dda1c0 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueryOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteTrainingQueryOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteUserDataOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteUserDataOptions.java index 0bc8bebbc92..cc0520b7466 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteUserDataOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DeleteUserDataOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAccepted.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAccepted.java index 32c3c326f96..6561cc79058 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAccepted.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAccepted.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAttribute.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAttribute.java index 4e268b32fcd..5e0ce17672a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAttribute.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentAttribute.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifier.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifier.java index 7b807f69968..db50d4be524 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifier.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifier.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierEnrichment.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierEnrichment.java index 94a7cfd17f7..1fcd6dfcc5a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierEnrichment.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierEnrichment.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModel.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModel.java index cc3ba0cd40c..8f482120848 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModel.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModel.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModels.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModels.java index 0a0c006ca5b..559257d50bf 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModels.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifierModels.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifiers.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifiers.java index 9a885735f3c..97cf7d2afdb 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifiers.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentClassifiers.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetails.java index 3db1993a344..4440830478f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetails.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetails.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetailsChildren.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetailsChildren.java index 0ccc1bee70e..a0ca90dfed9 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetailsChildren.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/DocumentDetailsChildren.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichment.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichment.java index 74ecf80c38c..5070dd19727 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichment.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichment.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/EnrichmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/EnrichmentOptions.java index baea3a8148f..966661ed583 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/EnrichmentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/EnrichmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichments.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichments.java index 1899329be3d..ed8de108bb1 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichments.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Enrichments.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansion.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansion.java index fd3031a46b7..41fc7d7c1b7 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansion.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansion.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansions.java index cbe5358cbb3..9b1fed43e12 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Expansions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Field.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Field.java index 7578bbb803a..7b774eebf85 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Field.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Field.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetAutocompletionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetAutocompletionOptions.java index 6136d04d012..72528d59733 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetAutocompletionOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetAutocompletionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetCollectionOptions.java index 332998d3b63..35f76d8713a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetCollectionOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetCollectionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetComponentSettingsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetComponentSettingsOptions.java index c41f0c3cef3..2be55eef734 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetComponentSettingsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetComponentSettingsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierModelOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierModelOptions.java index 262a818cae9..1eb988d99f1 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierModelOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierOptions.java index a0cbf320d2e..0dcdc3798aa 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentClassifierOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentOptions.java index fcc44584f7d..bc13de61ae6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetDocumentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetEnrichmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetEnrichmentOptions.java index 7082e8a30f1..95c34a281e9 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetEnrichmentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetEnrichmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetProjectOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetProjectOptions.java index 5ba084acca5..30e1be711d9 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetProjectOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetProjectOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetStopwordListOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetStopwordListOptions.java index 689fdca7a66..1e0bdb40e09 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetStopwordListOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetStopwordListOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetTrainingQueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetTrainingQueryOptions.java index a1c6c76a3f9..7b3395b73d5 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetTrainingQueryOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/GetTrainingQueryOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesOptions.java similarity index 50% rename from discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetCollectionOptions.java rename to discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesOptions.java index b25ffab45a2..d2ad01f3379 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/GetCollectionOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2017, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,29 +10,30 @@ * 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.ibm.watson.discovery.v1.model; + +package com.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; -/** The getCollection options. */ -public class GetCollectionOptions extends GenericModel { +/** The listBatches options. */ +public class ListBatchesOptions extends GenericModel { - protected String environmentId; + protected String projectId; protected String collectionId; /** Builder. */ public static class Builder { - private String environmentId; + private String projectId; private String collectionId; /** - * Instantiates a new Builder from an existing GetCollectionOptions instance. + * Instantiates a new Builder from an existing ListBatchesOptions instance. * - * @param getCollectionOptions the instance to initialize the Builder with + * @param listBatchesOptions the instance to initialize the Builder with */ - private Builder(GetCollectionOptions getCollectionOptions) { - this.environmentId = getCollectionOptions.environmentId; - this.collectionId = getCollectionOptions.collectionId; + private Builder(ListBatchesOptions listBatchesOptions) { + this.projectId = listBatchesOptions.projectId; + this.collectionId = listBatchesOptions.collectionId; } /** Instantiates a new builder. */ @@ -41,31 +42,31 @@ public Builder() {} /** * Instantiates a new builder with required properties. * - * @param environmentId the environmentId + * @param projectId the projectId * @param collectionId the collectionId */ - public Builder(String environmentId, String collectionId) { - this.environmentId = environmentId; + public Builder(String projectId, String collectionId) { + this.projectId = projectId; this.collectionId = collectionId; } /** - * Builds a GetCollectionOptions. + * Builds a ListBatchesOptions. * - * @return the new GetCollectionOptions instance + * @return the new ListBatchesOptions instance */ - public GetCollectionOptions build() { - return new GetCollectionOptions(this); + public ListBatchesOptions build() { + return new ListBatchesOptions(this); } /** - * Set the environmentId. + * Set the projectId. * - * @param environmentId the environmentId - * @return the GetCollectionOptions builder + * @param projectId the projectId + * @return the ListBatchesOptions builder */ - public Builder environmentId(String environmentId) { - this.environmentId = environmentId; + public Builder projectId(String projectId) { + this.projectId = projectId; return this; } @@ -73,7 +74,7 @@ public Builder environmentId(String environmentId) { * Set the collectionId. * * @param collectionId the collectionId - * @return the GetCollectionOptions builder + * @return the ListBatchesOptions builder */ public Builder collectionId(String collectionId) { this.collectionId = collectionId; @@ -81,41 +82,41 @@ public Builder collectionId(String collectionId) { } } - protected GetCollectionOptions() {} + protected ListBatchesOptions() {} - protected GetCollectionOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.environmentId, "environmentId cannot be empty"); + protected ListBatchesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.projectId, "projectId cannot be empty"); com.ibm.cloud.sdk.core.util.Validator.notEmpty( builder.collectionId, "collectionId cannot be empty"); - environmentId = builder.environmentId; + projectId = builder.projectId; collectionId = builder.collectionId; } /** * New builder. * - * @return a GetCollectionOptions builder + * @return a ListBatchesOptions builder */ public Builder newBuilder() { return new Builder(this); } /** - * Gets the environmentId. + * Gets the projectId. * - *

The ID of the environment. + *

The Universally Unique Identifier (UUID) of the project. This information can be found from + * the *Integrate and Deploy* page in Discovery. * - * @return the environmentId + * @return the projectId */ - public String environmentId() { - return environmentId; + public String projectId() { + return projectId; } /** * Gets the collectionId. * - *

The ID of the collection. + *

The Universally Unique Identifier (UUID) of the collection. * * @return the collectionId */ diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Completions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesResponse.java similarity index 57% rename from discovery/src/main/java/com/ibm/watson/discovery/v1/model/Completions.java rename to discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesResponse.java index d09e5ae59a5..8ad9f8a471c 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v1/model/Completions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListBatchesResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -10,26 +10,30 @@ * 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.ibm.watson.discovery.v1.model; + +package com.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; import java.util.List; -/** An object containing an array of autocompletion suggestions. */ -public class Completions extends GenericModel { +/** + * An object that contains a list of batches that are ready for enrichment by the external + * application. + */ +public class ListBatchesResponse extends GenericModel { - protected List completions; + protected List batches; - protected Completions() {} + protected ListBatchesResponse() {} /** - * Gets the completions. + * Gets the batches. * - *

Array of autcomplete suggestion based on the provided prefix. + *

An array that lists the batches in a collection. * - * @return the completions + * @return the batches */ - public List getCompletions() { - return completions; + public List getBatches() { + return batches; } } diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsOptions.java index 78be90e1dfb..d1d4277b574 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsResponse.java index 1c8b098a4d1..ce6cd252084 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListCollectionsResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifierModelsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifierModelsOptions.java index 6a8a2eede8f..ad5302611e4 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifierModelsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifierModelsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifiersOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifiersOptions.java index f63c0680fd4..4184363c2a2 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifiersOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentClassifiersOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsOptions.java index 3d4fc99d937..a4881ab0442 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsResponse.java index 72d3c3435bf..37fc80d0d26 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListDocumentsResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListEnrichmentsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListEnrichmentsOptions.java index d012519e506..1134fcf62b0 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListEnrichmentsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListEnrichmentsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListExpansionsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListExpansionsOptions.java index 287760564a0..35d8a20b40f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListExpansionsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListExpansionsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsOptions.java index e373e8f29c7..6de91251c10 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsResponse.java index 767029e3410..f2ab4f5eb5c 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListFieldsResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsOptions.java index 0c7ff091009..c561ddbbaa4 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsResponse.java index 3bf338295b6..d80dbaa4f26 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListProjectsResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListTrainingQueriesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListTrainingQueriesOptions.java index 8bce0a07a0d..2fab873f4d2 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListTrainingQueriesOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ListTrainingQueriesOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMacroAverage.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMacroAverage.java index 06da580e901..35a230e8811 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMacroAverage.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMacroAverage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMicroAverage.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMicroAverage.java index 16e1d6314b6..48fb2c4cdb9 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMicroAverage.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ModelEvaluationMicroAverage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Notice.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Notice.java index 632c90c10cd..743f2aed93a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Notice.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/Notice.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PerClassModelEvaluation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PerClassModelEvaluation.java index f3397e91dbf..2112aef7fb5 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PerClassModelEvaluation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PerClassModelEvaluation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectDetails.java index 24800540a40..86d08058bff 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectDetails.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectDetails.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetails.java index d93651447aa..75f708329db 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetails.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetails.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetailsRelevancyTrainingStatus.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetailsRelevancyTrainingStatus.java index 9ed84bb695a..4ff60c983c4 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetailsRelevancyTrainingStatus.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ProjectListDetailsRelevancyTrainingStatus.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PullBatchesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PullBatchesOptions.java new file mode 100644 index 00000000000..5684ab4793f --- /dev/null +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PullBatchesOptions.java @@ -0,0 +1,156 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.discovery.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** The pullBatches options. */ +public class PullBatchesOptions extends GenericModel { + + protected String projectId; + protected String collectionId; + protected String batchId; + + /** Builder. */ + public static class Builder { + private String projectId; + private String collectionId; + private String batchId; + + /** + * Instantiates a new Builder from an existing PullBatchesOptions instance. + * + * @param pullBatchesOptions the instance to initialize the Builder with + */ + private Builder(PullBatchesOptions pullBatchesOptions) { + this.projectId = pullBatchesOptions.projectId; + this.collectionId = pullBatchesOptions.collectionId; + this.batchId = pullBatchesOptions.batchId; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param projectId the projectId + * @param collectionId the collectionId + * @param batchId the batchId + */ + public Builder(String projectId, String collectionId, String batchId) { + this.projectId = projectId; + this.collectionId = collectionId; + this.batchId = batchId; + } + + /** + * Builds a PullBatchesOptions. + * + * @return the new PullBatchesOptions instance + */ + public PullBatchesOptions build() { + return new PullBatchesOptions(this); + } + + /** + * Set the projectId. + * + * @param projectId the projectId + * @return the PullBatchesOptions builder + */ + public Builder projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Set the collectionId. + * + * @param collectionId the collectionId + * @return the PullBatchesOptions builder + */ + public Builder collectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Set the batchId. + * + * @param batchId the batchId + * @return the PullBatchesOptions builder + */ + public Builder batchId(String batchId) { + this.batchId = batchId; + return this; + } + } + + protected PullBatchesOptions() {} + + protected PullBatchesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.projectId, "projectId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.collectionId, "collectionId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.batchId, "batchId cannot be empty"); + projectId = builder.projectId; + collectionId = builder.collectionId; + batchId = builder.batchId; + } + + /** + * New builder. + * + * @return a PullBatchesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the projectId. + * + *

The Universally Unique Identifier (UUID) of the project. This information can be found from + * the *Integrate and Deploy* page in Discovery. + * + * @return the projectId + */ + public String projectId() { + return projectId; + } + + /** + * Gets the collectionId. + * + *

The Universally Unique Identifier (UUID) of the collection. + * + * @return the collectionId + */ + public String collectionId() { + return collectionId; + } + + /** + * Gets the batchId. + * + *

The Universally Unique Identifier (UUID) of the document batch that is being requested from + * Discovery. + * + * @return the batchId + */ + public String batchId() { + return batchId; + } +} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PullBatchesResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PullBatchesResponse.java new file mode 100644 index 00000000000..bc895802a6d --- /dev/null +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PullBatchesResponse.java @@ -0,0 +1,40 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.discovery.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; + +/** + * A compressed newline delimited JSON (NDJSON) file containing the document. The NDJSON format is + * used to describe structured data. The file name format is `{batch_id}.ndjson.gz`. For more + * information, see [Binary attachment from the pull batches + * method](/docs/discovery-data?topic=discovery-data-external-enrichment#binary-attachment-pull-batches). + */ +public class PullBatchesResponse extends GenericModel { + + protected String file; + + protected PullBatchesResponse() {} + + /** + * Gets the file. + * + *

A compressed NDJSON file containing the document. + * + * @return the file + */ + public String getFile() { + return file; + } +} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PushBatchesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PushBatchesOptions.java new file mode 100644 index 00000000000..af86c0af80a --- /dev/null +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/PushBatchesOptions.java @@ -0,0 +1,234 @@ +/* + * (C) Copyright IBM Corp. 2024. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package com.ibm.watson.discovery.v2.model; + +import com.ibm.cloud.sdk.core.service.model.GenericModel; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; + +/** The pushBatches options. */ +public class PushBatchesOptions extends GenericModel { + + protected String projectId; + protected String collectionId; + protected String batchId; + protected InputStream file; + protected String filename; + + /** Builder. */ + public static class Builder { + private String projectId; + private String collectionId; + private String batchId; + private InputStream file; + private String filename; + + /** + * Instantiates a new Builder from an existing PushBatchesOptions instance. + * + * @param pushBatchesOptions the instance to initialize the Builder with + */ + private Builder(PushBatchesOptions pushBatchesOptions) { + this.projectId = pushBatchesOptions.projectId; + this.collectionId = pushBatchesOptions.collectionId; + this.batchId = pushBatchesOptions.batchId; + this.file = pushBatchesOptions.file; + this.filename = pushBatchesOptions.filename; + } + + /** Instantiates a new builder. */ + public Builder() {} + + /** + * Instantiates a new builder with required properties. + * + * @param projectId the projectId + * @param collectionId the collectionId + * @param batchId the batchId + */ + public Builder(String projectId, String collectionId, String batchId) { + this.projectId = projectId; + this.collectionId = collectionId; + this.batchId = batchId; + } + + /** + * Builds a PushBatchesOptions. + * + * @return the new PushBatchesOptions instance + */ + public PushBatchesOptions build() { + return new PushBatchesOptions(this); + } + + /** + * Set the projectId. + * + * @param projectId the projectId + * @return the PushBatchesOptions builder + */ + public Builder projectId(String projectId) { + this.projectId = projectId; + return this; + } + + /** + * Set the collectionId. + * + * @param collectionId the collectionId + * @return the PushBatchesOptions builder + */ + public Builder collectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + * Set the batchId. + * + * @param batchId the batchId + * @return the PushBatchesOptions builder + */ + public Builder batchId(String batchId) { + this.batchId = batchId; + return this; + } + + /** + * Set the file. + * + * @param file the file + * @return the PushBatchesOptions builder + */ + public Builder file(InputStream file) { + this.file = file; + return this; + } + + /** + * Set the filename. + * + * @param filename the filename + * @return the PushBatchesOptions builder + */ + public Builder filename(String filename) { + this.filename = filename; + return this; + } + + /** + * Set the file. + * + * @param file the file + * @return the PushBatchesOptions builder + * @throws FileNotFoundException if the file could not be found + */ + public Builder file(File file) throws FileNotFoundException { + this.file = new FileInputStream(file); + this.filename = file.getName(); + return this; + } + } + + protected PushBatchesOptions() {} + + protected PushBatchesOptions(Builder builder) { + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.projectId, "projectId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty( + builder.collectionId, "collectionId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.batchId, "batchId cannot be empty"); + com.ibm.cloud.sdk.core.util.Validator.isTrue( + (builder.file == null) || (builder.filename != null), + "filename cannot be null if file is not null."); + projectId = builder.projectId; + collectionId = builder.collectionId; + batchId = builder.batchId; + file = builder.file; + filename = builder.filename; + } + + /** + * New builder. + * + * @return a PushBatchesOptions builder + */ + public Builder newBuilder() { + return new Builder(this); + } + + /** + * Gets the projectId. + * + *

The Universally Unique Identifier (UUID) of the project. This information can be found from + * the *Integrate and Deploy* page in Discovery. + * + * @return the projectId + */ + public String projectId() { + return projectId; + } + + /** + * Gets the collectionId. + * + *

The Universally Unique Identifier (UUID) of the collection. + * + * @return the collectionId + */ + public String collectionId() { + return collectionId; + } + + /** + * Gets the batchId. + * + *

The Universally Unique Identifier (UUID) of the document batch that is being requested from + * Discovery. + * + * @return the batchId + */ + public String batchId() { + return batchId; + } + + /** + * Gets the file. + * + *

A compressed newline-delimited JSON (NDJSON), which is a JSON file with one row of data per + * line. For example, `{batch_id}.ndjson.gz`. For more information, see [Binary attachment in the + * push batches + * method](/docs/discovery-data?topic=discovery-data-external-enrichment#binary-attachment-push-batches). + * + *

There is no limitation on the name of the file because Discovery does not use the name for + * processing. The list of features in the document is specified in the `features` object. + * + * @return the file + */ + public InputStream file() { + return file; + } + + /** + * Gets the filename. + * + *

The filename for file. + * + * @return the filename + */ + public String filename() { + return filename; + } +} diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregation.java index 78336453cef..7cabf8636dd 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryCalculationAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryCalculationAggregation.java index 7c19cc9ffce..26a0effdb9a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryCalculationAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryCalculationAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; /** diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryFilterAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryFilterAggregation.java index cfe378d53d6..a6919f70e7b 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryFilterAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryFilterAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; /** A modifier that narrows the document set of the subaggregations it precedes. */ diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryGroupByAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryGroupByAggregation.java index b938bfaa324..bbd2f0bf2ee 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryGroupByAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryGroupByAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryHistogramAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryHistogramAggregation.java index 3bf854e2991..198c555edfc 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryHistogramAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryHistogramAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryNestedAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryNestedAggregation.java index f619de39a20..12c0a9c5805 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryNestedAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryNestedAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; /** diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryPairAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryPairAggregation.java index 9a956f969ae..a4da517ff8c 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryPairAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryPairAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTermAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTermAggregation.java index 186e981a493..d512af8f6e4 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTermAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTermAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTimesliceAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTimesliceAggregation.java index b2a62375cee..34cfd56179f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTimesliceAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTimesliceAggregation.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopHitsAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopHitsAggregation.java index 434d249b233..0a147fc2ec8 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopHitsAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopHitsAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopicAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopicAggregation.java index c923e543ef6..4e0109c6f97 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopicAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTopicAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTrendAggregation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTrendAggregation.java index ea83353485a..ee38b65ec9a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTrendAggregation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryAggregationQueryTrendAggregation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import java.util.List; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryCollectionNoticesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryCollectionNoticesOptions.java index 6065328419f..6c9859786f2 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryCollectionNoticesOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryCollectionNoticesOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -178,8 +179,8 @@ public Builder newBuilder() { /** * Gets the projectId. * - *

The ID of the project. This information can be found from the *Integrate and Deploy* page in - * Discovery. + *

The Universally Unique Identifier (UUID) of the project. This information can be found from + * the *Integrate and Deploy* page in Discovery. * * @return the projectId */ @@ -190,7 +191,7 @@ public String projectId() { /** * Gets the collectionId. * - *

The ID of the collection. + *

The Universally Unique Identifier (UUID) of the collection. * * @return the collectionId */ diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryGroupByAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryGroupByAggregationResult.java index 6ea88e04f29..6dc6e6b1275 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryGroupByAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryGroupByAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryHistogramAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryHistogramAggregationResult.java index 1f28682393c..e7e9327eafc 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryHistogramAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryHistogramAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargePassages.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargePassages.java index a9a4c792143..804e9c86a5a 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargePassages.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargePassages.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSimilar.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSimilar.java index 883ad6f1f02..dd81cf096fa 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSimilar.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSimilar.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSuggestedRefinements.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSuggestedRefinements.java index 8b7e49ccf7b..03fd2e0a0bc 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSuggestedRefinements.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeSuggestedRefinements.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeTableResults.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeTableResults.java index 18d7b7de207..4510f6ac52b 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeTableResults.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryLargeTableResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesOptions.java index d50937249fe..e4072f6688e 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesResponse.java index 38af3db30c9..874b6aabc87 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryNoticesResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryOptions.java index 4f6a614cd4f..03c409deb13 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -446,8 +447,15 @@ public List xReturn() { /** * Gets the offset. * - *

The number of query results to skip at the beginning. For example, if the total number of - * results that are returned is 10 and the offset is 8, it returns the last two results. + *

The number of query results to skip at the beginning. Consider that the `count` is set to 10 + * (the default value) and the total number of results that are returned is 100. In this case, the + * following examples show the returned results for different `offset` values: + * + *

* If `offset` is set to 95, it returns the last 5 results. + * + *

* If `offset` is set to 10, it returns the second batch of 10 results. + * + *

* If `offset` is set to 100 or more, it returns empty results. * * @return the offset */ diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryPairAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryPairAggregationResult.java index 02c78d25008..d3da1992d6f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryPairAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryPairAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponse.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponse.java index 5d774a6d0d0..d3840a7058c 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponse.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponsePassage.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponsePassage.java index 77a3c3c888c..bd8295bee9f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponsePassage.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResponsePassage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResult.java index 05388eac522..a126a24114f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; @@ -18,7 +19,11 @@ import java.util.List; import java.util.Map; -/** Result document for the specified query. */ +/** + * Result document for the specified query. + * + *

This type supports additional properties of type Object. The remaining key-value pairs. + */ public class QueryResult extends DynamicModel { @SerializedName("document_id") diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultMetadata.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultMetadata.java index 5c37df20ec9..b8225b35dd7 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultMetadata.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultPassage.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultPassage.java index 552fd71b0d3..9c9e82588b1 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultPassage.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryResultPassage.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QuerySuggestedRefinement.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QuerySuggestedRefinement.java index 61f2176f040..78813097492 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QuerySuggestedRefinement.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QuerySuggestedRefinement.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTableResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTableResult.java index eb388eccbad..6f79b5367cd 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTableResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTableResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTermAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTermAggregationResult.java index 0603746e748..3dc53751d36 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTermAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTermAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTimesliceAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTimesliceAggregationResult.java index e1e02efe480..a35b541d1f1 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTimesliceAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTimesliceAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopHitsAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopHitsAggregationResult.java index cb9107b2e10..3b0a65566d1 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopHitsAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopHitsAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopicAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopicAggregationResult.java index 3dc978de200..35c4b4cdcd2 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopicAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTopicAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTrendAggregationResult.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTrendAggregationResult.java index f15d77694dd..ae89e655a30 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTrendAggregationResult.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/QueryTrendAggregationResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2023. + * (C) Copyright IBM Corp. 2023, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ResultPassageAnswer.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ResultPassageAnswer.java index 18ad6c2ff68..481fbdf12b5 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ResultPassageAnswer.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/ResultPassageAnswer.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/RetrievalDetails.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/RetrievalDetails.java index 50967926cef..cbb2dbf140d 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/RetrievalDetails.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/RetrievalDetails.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/StopWordList.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/StopWordList.java index 0234e111479..a42dc874f63 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/StopWordList.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/StopWordList.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableBodyCells.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableBodyCells.java index 7330a0c778d..2274a56e4df 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableBodyCells.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableBodyCells.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellKey.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellKey.java index 2fab9623136..999e4244d5f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellKey.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellKey.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellValues.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellValues.java index 0483b53df8b..7dabdd25825 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellValues.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableCellValues.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableColumnHeaders.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableColumnHeaders.java index 55938549ce8..2c48b7d3408 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableColumnHeaders.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableColumnHeaders.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableElementLocation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableElementLocation.java index 4620571d5f5..64dd5f2c678 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableElementLocation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableElementLocation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableHeaders.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableHeaders.java index f6a66b1cb9d..41f62d2fbab 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableHeaders.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableHeaders.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableKeyValuePairs.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableKeyValuePairs.java index bfc5f7789fd..1b93fd28d43 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableKeyValuePairs.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableKeyValuePairs.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableResultTable.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableResultTable.java index cbfe5daef34..718d00f56ed 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableResultTable.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableResultTable.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableRowHeaders.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableRowHeaders.java index 539ecdaf777..23f990bd81f 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableRowHeaders.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableRowHeaders.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableTextLocation.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableTextLocation.java index 022a84bc9be..b1308b4e16e 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableTextLocation.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TableTextLocation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingExample.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingExample.java index 0066ab82069..c2d02cf1c29 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingExample.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingExample.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuery.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuery.java index 9944b305388..8a2d95bfd31 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuery.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuery.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.google.gson.annotations.SerializedName; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuerySet.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuerySet.java index 9c3936e56f9..77f2e94e23d 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuerySet.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/TrainingQuerySet.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateCollectionOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateCollectionOptions.java index d1c0cc8f29a..baae8079b03 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateCollectionOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateCollectionOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifier.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifier.java index fbc5a9f9fc6..330258583f6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifier.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifier.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2022, 2023. + * (C) Copyright IBM Corp. 2022, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierModelOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierModelOptions.java index af860875458..a9f7616effa 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierModelOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierOptions.java index f23fdbe8dde..b97ac9c8084 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentClassifierOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentOptions.java index 9c58dd4b127..fc7282a1624 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateDocumentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateEnrichmentOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateEnrichmentOptions.java index 530e75d2b1d..0a2adf5ac91 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateEnrichmentOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateEnrichmentOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateProjectOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateProjectOptions.java index cb43c1e63c1..8736c708cb4 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateProjectOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateProjectOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateTrainingQueryOptions.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateTrainingQueryOptions.java index dadc0a4cc3d..70c52b8a757 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateTrainingQueryOptions.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/UpdateTrainingQueryOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/WebhookHeader.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/WebhookHeader.java index b8dcf9a18d8..7b67a8eb232 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/model/WebhookHeader.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/model/WebhookHeader.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/discovery/src/main/java/com/ibm/watson/discovery/v2/package-info.java b/discovery/src/main/java/com/ibm/watson/discovery/v2/package-info.java index cbaa3e0ed7f..a93b9daa2e6 100644 --- a/discovery/src/main/java/com/ibm/watson/discovery/v2/package-info.java +++ b/discovery/src/main/java/com/ibm/watson/discovery/v2/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,5 +10,6 @@ * 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. */ + /** Discovery v2 v2. */ package com.ibm.watson.discovery.v2; diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryServiceIT.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryServiceIT.java deleted file mode 100644 index b7a1039e877..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryServiceIT.java +++ /dev/null @@ -1,2401 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.google.gson.internal.LazilyParsedNumber; -import com.ibm.cloud.sdk.core.http.HttpConfigOptions; -import com.ibm.cloud.sdk.core.http.HttpMediaType; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.BasicAuthenticator; -import com.ibm.cloud.sdk.core.security.BearerTokenAuthenticator; -import com.ibm.cloud.sdk.core.security.IamAuthenticator; -import com.ibm.cloud.sdk.core.service.exception.*; -import com.ibm.cloud.sdk.core.util.GsonSingleton; -import com.ibm.watson.common.RetryRunner; -import com.ibm.watson.common.WaitFor; -import com.ibm.watson.common.WatsonServiceTest; -import com.ibm.watson.discovery.query.AggregationType; -import com.ibm.watson.discovery.query.Operator; -import com.ibm.watson.discovery.v1.model.*; -import com.ibm.watson.discovery.v1.model.NormalizationOperation.Operation; -import java.awt.*; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.TimeUnit; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** Integration tests for {@link Discovery}. */ -@RunWith(RetryRunner.class) -public class DiscoveryServiceIT extends WatsonServiceTest { - - private static final String DISCOVERY1_TEST_CONFIG_FILE = - "src/test/resources/discovery/v1/issue517.json"; - private static final String DISCOVERY2_TEST_CONFIG_FILE = - "src/test/resources/discovery/v1/issue518.json"; - private static final String PASSAGES_TEST_FILE_1 = - "src/test/resources/discovery/v1/passages_test_doc_1.json"; - private static final String PASSAGES_TEST_FILE_2 = - "src/test/resources/discovery/v1/passages_test_doc_2.json"; - private static final String STOPWORDS_TEST_FILE = "src/test/resources/discovery/v1/stopwords.txt"; - private static String environmentId; - private static String collectionId; - private Discovery discovery; - private String uniqueName; - - private Set configurationIds = new HashSet<>(); - private Set collectionIds = new HashSet<>(); - - private static DiscoveryServiceIT dummyTest; - - /** - * Setup class. - * - * @throws Exception the exception - */ - @BeforeClass - public static void setupClass() throws Exception { - // get the properties - dummyTest = new DiscoveryServiceIT(); - String apiKey = System.getenv("DISCOVERY_APIKEY"); - - if (apiKey == null) { - apiKey = dummyTest.getProperty("discovery.apikey"); - } - - assertNotNull( - "DISCOVERY_APIKEY is not defined and config.properties doesn't have valid credentials.", - apiKey); - - dummyTest.setup(); - - ListEnvironmentsOptions listOptions = new ListEnvironmentsOptions.Builder().build(); - ListEnvironmentsResponse listResponse = - dummyTest.discovery.listEnvironments(listOptions).execute().getResult(); - for (Environment environment : listResponse.getEnvironments()) { - // look for an existing environment that isn't read only - if (!environment.isReadOnly()) { - environmentId = environment.getEnvironmentId(); - break; - } - } - - if (environmentId == null) { - // no environment found, create a new one (assuming we are a FREE plan) - String environmentName = "watson_developer_cloud_test_environment"; - CreateEnvironmentOptions createOptions = - new CreateEnvironmentOptions.Builder().name(environmentName).build(); - Environment createResponse = - dummyTest.discovery.createEnvironment(createOptions).execute().getResult(); - environmentId = createResponse.getEnvironmentId(); - WaitFor.Condition environmentReady = new EnvironmentReady(dummyTest.discovery, environmentId); - WaitFor.waitFor(environmentReady, 30, TimeUnit.SECONDS, 500); - } - - collectionId = dummyTest.setupTestDocuments(); - } - - /** - * Cleanup class. - * - * @throws Exception the exception - */ - @AfterClass - public static void cleanupClass() throws Exception { - dummyTest.cleanup(); - } - - /** - * Setup. - * - * @throws Exception the exception - */ - @Before - public void setup() throws Exception { - super.setUp(); - String apiKey = System.getenv("DISCOVERY_APIKEY"); - String serviceUrl = System.getenv("DISCOVERY_URL"); - - if (apiKey == null) { - apiKey = getProperty("discovery.apikey"); - serviceUrl = getProperty("discovery.url"); - } - - Authenticator authenticator = new IamAuthenticator(apiKey); - discovery = new Discovery("2019-04-30", authenticator); - discovery.setServiceUrl(serviceUrl); - discovery.setDefaultHeaders(getDefaultHeaders()); - - uniqueName = UUID.randomUUID().toString(); - } - - /** Cleanup. */ - public void cleanup() { - for (String collectionId : collectionIds) { - DeleteCollectionOptions deleteOptions = - new DeleteCollectionOptions.Builder(environmentId, collectionId).build(); - try { - discovery.deleteCollection(deleteOptions).execute(); - } catch (NotFoundException ex) { - // Ignore this failure - just print msg - // System.out.println("deleteCollection failed. Collection " + collectionId + " not found"); - } - } - - for (String configurationId : configurationIds) { - DeleteConfigurationOptions deleteOptions = - new DeleteConfigurationOptions.Builder(environmentId, configurationId).build(); - try { - discovery.deleteConfiguration(deleteOptions).execute(); - } catch (NotFoundException ex) { - // Ignore this failure - just print msg - // System.out.println("deleteConfiguration failed. Configuration " + configurationId + " not - // found"); - } - } - - ListCollectionsOptions listCollectionsOptions = - new ListCollectionsOptions.Builder().environmentId(environmentId).build(); - ListCollectionsResponse response = - discovery.listCollections(listCollectionsOptions).execute().getResult(); - for (Collection collection : response.getCollections()) { - if (collection.getName().matches("java-sdk-.*collection") - || collection.getName().matches("my_watson_developer_cloud_collection.*") - || collection.getName().matches("tokenization-dict-testing-collection.*")) { - DeleteCollectionOptions deleteCollectionOptions = - new DeleteCollectionOptions.Builder() - .collectionId(collection.getCollectionId()) - .environmentId(environmentId) - .build(); - try { - DeleteCollectionResponse deleteCollectionResponse = - discovery.deleteCollection(deleteCollectionOptions).execute().getResult(); - } catch (NotFoundException ex) { - // System.out.println("deleteCollection failed. Collection " + collectionId + " not - // found"); - } - } - } - collectionId = null; - } - - /** - * Ping. - * - * @throws RuntimeException the runtime exception - */ - public boolean ping() throws RuntimeException { - discovery.listEnvironments(null).execute().getResult(); - return true; - } - - private static final String DEFAULT_CONFIG_NAME = "Default Configuration"; - - /** Example is successful. */ - @Test - public void exampleIsSuccessful() { - // Discovery discovery = new Discovery("2016-12-15"); - // discovery.setServiceUrl("https://api.us-south.discovery.watson.cloud.ibm.com"); - // discovery.setUsernameAndPassword("", " normalizations = Collections.singletonList(operation); - - NluEnrichmentSentiment sentiment = new NluEnrichmentSentiment.Builder().document(true).build(); - NluEnrichmentEmotion emotion = new NluEnrichmentEmotion.Builder().document(true).build(); - NluEnrichmentEntities entities = - new NluEnrichmentEntities.Builder() - .emotion(true) - .sentiment(true) - .model("WhatComesAfterQux") - .build(); - NluEnrichmentKeywords keywords = - new NluEnrichmentKeywords.Builder().emotion(true).sentiment(true).build(); - NluEnrichmentSemanticRoles semanticRoles = - new NluEnrichmentSemanticRoles.Builder().entities(true).build(); - NluEnrichmentFeatures features = - new NluEnrichmentFeatures.Builder() - .sentiment(sentiment) - .emotion(emotion) - .entities(entities) - .keywords(keywords) - .semanticRoles(semanticRoles) - .build(); - EnrichmentOptions options = - new EnrichmentOptions.Builder() - .features(features) - .language(EnrichmentOptions.Language.EN) - .build(); - - Enrichment enrichment = - new Enrichment.Builder() - .sourceField("foo") - .destinationField("bar") - .enrichment("baz") - .description("Erich foo to bar with baz") - .ignoreDownstreamErrors(true) - .overwrite(false) - .options(options) - .build(); - List enrichments = Collections.singletonList(enrichment); - - CreateConfigurationOptions createOptions = - new CreateConfigurationOptions.Builder() - .environmentId(environmentId) - .name(uniqueConfigName) - .description(description) - .conversions(conversionsBuilder.build()) - .normalizations(normalizations) - .enrichments(enrichments) - .build(); - Configuration createResponse = createConfiguration(createOptions); - - assertEquals(uniqueConfigName, createResponse.name()); - assertEquals(description, createResponse.description()); - assertEquals(conversionsBuilder.build(), createResponse.conversions()); - assertEquals(normalizations, createResponse.normalizations()); - assertEquals(enrichments, createResponse.enrichments()); - - Date now = new Date(); - assertTrue(fuzzyBefore(createResponse.created(), now)); - assertTrue(fuzzyAfter(createResponse.created(), start)); - assertTrue(fuzzyBefore(createResponse.updated(), now)); - assertTrue(fuzzyAfter(createResponse.updated(), start)); - } - - /** Delete configuration is successful. */ - @Test - public void deleteConfigurationIsSuccessful() { - Configuration createResponse = createTestConfig(); - - DeleteConfigurationOptions deleteOptions = - new DeleteConfigurationOptions.Builder(environmentId, createResponse.configurationId()) - .build(); - deleteConfiguration(deleteOptions); - } - - /** Gets the configuration is successful. */ - @Test - public void getConfigurationIsSuccessful() { - Configuration createResponse = createTestConfig(); - - GetConfigurationOptions getOptions = - new GetConfigurationOptions.Builder(environmentId, createResponse.configurationId()) - .build(); - Configuration getResponse = discovery.getConfiguration(getOptions).execute().getResult(); - - assertEquals(createResponse.name(), getResponse.name()); - } - - /** Gets the configurations by name is successful. */ - @Test - public void getConfigurationsByNameIsSuccessful() { - Configuration createResponse = createTestConfig(); - - ListConfigurationsOptions.Builder getBuilder = - new ListConfigurationsOptions.Builder(environmentId); - getBuilder.name(createResponse.name()); - ListConfigurationsResponse getResponse = - discovery.listConfigurations(getBuilder.build()).execute().getResult(); - - assertEquals(1, getResponse.getConfigurations().size()); - assertEquals(createResponse.name(), getResponse.getConfigurations().get(0).name()); - } - - /** Gets the configurations with funky name is successful. */ - @Test - public void getConfigurationsWithFunkyNameIsSuccessful() { - String uniqueConfigName = - uniqueName + " with \"funky\" ?x=y&foo=bar ,[x](y) ~!@#$%^&*()-+ {} | ;:<>\\/ chars"; - - CreateConfigurationOptions.Builder createBuilder = - new CreateConfigurationOptions.Builder(environmentId, uniqueConfigName); - createConfiguration(createBuilder.build()); - - ListConfigurationsOptions.Builder getBuilder = - new ListConfigurationsOptions.Builder(environmentId); - getBuilder.name(uniqueConfigName); - ListConfigurationsResponse getResponse = - discovery.listConfigurations(getBuilder.build()).execute().getResult(); - - assertEquals(1, getResponse.getConfigurations().size()); - assertEquals(uniqueConfigName, getResponse.getConfigurations().get(0).name()); - } - - /** Update configuration is successful. */ - @Test - public void updateConfigurationIsSuccessful() { - - Configuration testConfig = createTestConfig(); - - Date start = new Date(); - - String updatedName = testConfig.name() + UUID.randomUUID().toString(); - String updatedDescription = "Description of " + updatedName; - HtmlSettings newHtmlSettings = - new HtmlSettings.Builder() - .excludeTagsCompletely(Arrays.asList("table", "h6", "header")) - .build(); - Conversions updatedConversions = new Conversions.Builder().html(newHtmlSettings).build(); - NormalizationOperation operation = - new NormalizationOperation.Builder() - .operation("foo") - .sourceField("bar") - .destinationField("baz") - .build(); - List updatedNormalizations = Arrays.asList(operation); - - NluEnrichmentSentiment sentiment = new NluEnrichmentSentiment.Builder().document(true).build(); - NluEnrichmentEmotion emotion = new NluEnrichmentEmotion.Builder().document(true).build(); - NluEnrichmentEntities entities = - new NluEnrichmentEntities.Builder() - .emotion(true) - .sentiment(true) - .model("WhatComesAfterQux") - .build(); - NluEnrichmentKeywords keywords = - new NluEnrichmentKeywords.Builder().emotion(true).sentiment(true).build(); - NluEnrichmentSemanticRoles semanticRoles = - new NluEnrichmentSemanticRoles.Builder().entities(true).build(); - NluEnrichmentFeatures features = - new NluEnrichmentFeatures.Builder() - .sentiment(sentiment) - .emotion(emotion) - .entities(entities) - .keywords(keywords) - .semanticRoles(semanticRoles) - .build(); - EnrichmentOptions options = new EnrichmentOptions.Builder().features(features).build(); - - Enrichment enrichment = - new Enrichment.Builder() - .sourceField("foo") - .destinationField("bar") - .enrichment("baz") - .description("Erich foo to bar with baz") - .ignoreDownstreamErrors(true) - .overwrite(false) - .options(options) - .build(); - List updatedEnrichments = Collections.singletonList(enrichment); - - UpdateConfigurationOptions.Builder updateBuilder = - new UpdateConfigurationOptions.Builder( - environmentId, testConfig.configurationId(), updatedName); - updateBuilder.description(updatedDescription); - updateBuilder.conversions(updatedConversions); - updateBuilder.normalizations(updatedNormalizations); - updateBuilder.enrichments(updatedEnrichments); - Configuration updatedConfiguration = - discovery.updateConfiguration(updateBuilder.build()).execute().getResult(); - - assertEquals(updatedName, updatedConfiguration.name()); - assertEquals(updatedDescription, updatedConfiguration.description()); - assertEquals(updatedConversions, updatedConfiguration.conversions()); - assertEquals(updatedNormalizations, updatedConfiguration.normalizations()); - assertEquals(updatedEnrichments, updatedConfiguration.enrichments()); - - Date now = new Date(); - assertTrue(fuzzyBefore(updatedConfiguration.created(), start)); - assertTrue(fuzzyBefore(updatedConfiguration.updated(), now)); - assertTrue(fuzzyAfter(updatedConfiguration.updated(), start)); - } - - // Collections - - /** List collections is successful. */ - @Test - public void listCollectionsIsSuccessful() { - createTestCollection(); - ListCollectionsOptions listOptions = new ListCollectionsOptions.Builder(environmentId).build(); - ListCollectionsResponse listResponse = - discovery.listCollections(listOptions).execute().getResult(); - - assertFalse(listResponse.getCollections().isEmpty()); - } - - /** Creates the collection is successful. */ - @Test - public void createCollectionIsSuccessful() { - Configuration createConfigResponse = createTestConfig(); - - String uniqueCollectionName = uniqueName + "-collection"; - String uniqueCollectionDescription = "Description of " + uniqueCollectionName; - - CreateCollectionOptions.Builder createCollectionBuilder = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(createConfigResponse.configurationId()) - .description(uniqueCollectionDescription); - Collection createResponse = createCollection(createCollectionBuilder.build()); - - assertEquals(createConfigResponse.configurationId(), createResponse.getConfigurationId()); - assertEquals(uniqueCollectionName, createResponse.getName()); - assertEquals(uniqueCollectionDescription, createResponse.getDescription()); - } - - /** Creates the collection with minimal parameters is successful. */ - @Test - public void createCollectionWithMinimalParametersIsSuccessful() { - String uniqueCollectionName = uniqueName + "-collection"; - CreateCollectionOptions createOptions = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName).build(); - Collection createResponse = createCollection(createOptions); - - assertNotNull(createResponse.getCollectionId()); - } - - /** Update collection is successful. */ - @Test - public void updateCollectionIsSuccessful() { - String uniqueCollectionName = uniqueName + "-collection"; - CreateCollectionOptions createOptions = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName).build(); - Collection collection = createCollection(createOptions); - assertNotNull(collection.getCollectionId()); - - Configuration testConfig = createTestConfig(); - String updatedCollectionName = UUID.randomUUID().toString() + "-collection"; - String updatedCollectionDescription = "Description for " + updatedCollectionName; - String newCollectionId = collection.getCollectionId(); - - UpdateCollectionOptions updateOptions = - new UpdateCollectionOptions.Builder() - .environmentId(environmentId) - .collectionId(newCollectionId) - .name(updatedCollectionName) - .description(updatedCollectionDescription) - .configurationId(testConfig.configurationId()) - .build(); - Collection updatedCollection = discovery.updateCollection(updateOptions).execute().getResult(); - - assertEquals(updatedCollectionName, updatedCollection.getName()); - assertEquals(updatedCollectionDescription, updatedCollection.getDescription()); - assertEquals(testConfig.configurationId(), updatedCollection.getConfigurationId()); - } - - /** Delete collection is successful. */ - @Test - public void deleteCollectionIsSuccessful() { - Configuration createConfigResponse = createTestConfig(); - - String uniqueCollectionName = uniqueName + "-collection"; - CreateCollectionOptions.Builder createCollectionBuilder = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(createConfigResponse.configurationId()); - Collection createResponse = createCollection(createCollectionBuilder.build()); - - // need to wait for collection to be ready - - DeleteCollectionOptions deleteOptions = - new DeleteCollectionOptions.Builder(environmentId, createResponse.getCollectionId()) - .build(); - deleteCollection(deleteOptions); - } - - /** Gets the collection is successful. */ - @Test - public void getCollectionIsSuccessful() { - Configuration createConfigResponse = createTestConfig(); - - String uniqueCollectionName = uniqueName + "-collection"; - CreateCollectionOptions.Builder createCollectionBuilder = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(createConfigResponse.configurationId()); - Collection createResponse = createCollection(createCollectionBuilder.build()); - - GetCollectionOptions getOptions = - new GetCollectionOptions.Builder(environmentId, createResponse.getCollectionId()).build(); - - // need to wait for collection to be ready - - Collection getResponse = discovery.getCollection(getOptions).execute().getResult(); - - assertEquals(createResponse.getName(), getResponse.getName()); - } - - /** Gets the collections by name is successful. */ - @Test - public void getCollectionsByNameIsSuccessful() { - Configuration createConfigResponse = createTestConfig(); - - String uniqueCollectionName = uniqueName + "-collection"; - CreateCollectionOptions.Builder createCollectionBuilder = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(createConfigResponse.configurationId()); - createCollection(createCollectionBuilder.build()); - - ListCollectionsOptions.Builder getBuilder = new ListCollectionsOptions.Builder(environmentId); - getBuilder.name(uniqueCollectionName); - ListCollectionsResponse getResponse = - discovery.listCollections(getBuilder.build()).execute().getResult(); - - assertEquals(1, getResponse.getCollections().size()); - assertEquals(uniqueCollectionName, getResponse.getCollections().get(0).getName()); - } - - /** Adds the document is successful. */ - @SuppressWarnings("deprecation") - @Test - public void addDocumentIsSuccessful() { - String myDocumentJson = "{\"field\":\"value\"}"; - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - AddDocumentOptions.Builder builder = new AddDocumentOptions.Builder(); - builder.environmentId(environmentId); - builder.collectionId(collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename(UUID.randomUUID().toString()); - DocumentAccepted createResponse = discovery.addDocument(builder.build()).execute().getResult(); - - assertFalse(createResponse.getDocumentId().isEmpty()); - assertNull(createResponse.getNotices()); - } - - /** Adds the document with configuration is successful. */ - @Test - public void addDocumentWithConfigurationIsSuccessful() { - uniqueName = UUID.randomUUID().toString(); - - String myDocumentJson = "{\"field\":\"value\"}"; - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - AddDocumentOptions.Builder builder = new AddDocumentOptions.Builder(); - builder.environmentId(environmentId); - builder.collectionId(collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename(UUID.randomUUID().toString()); - DocumentAccepted createResponse = discovery.addDocument(builder.build()).execute().getResult(); - - assertFalse(createResponse.getDocumentId().isEmpty()); - assertNull(createResponse.getNotices()); - } - - /** Adds the document with metadata is successful. */ - @Ignore - @SuppressWarnings("deprecation") - @Test - public void addDocumentWithMetadataIsSuccessful() { - String myDocumentJson = "{\"field\":\"value\"}"; - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename(UUID.randomUUID().toString()); - builder.metadata(myMetadata.toString()); - - DocumentAccepted createResponse = discovery.addDocument(builder.build()).execute().getResult(); - - WaitFor.Condition documentAccepted = - new WaitForDocumentAccepted(environmentId, collectionId, createResponse.getDocumentId()); - WaitFor.waitFor(documentAccepted, 5, TimeUnit.SECONDS, 500); - - QueryOptions queryOptions = new QueryOptions.Builder(environmentId, collectionId).build(); - QueryResponse queryResponse = discovery.query(queryOptions).execute().getResult(); - - assertTrue(queryResponse.getResults().get(0).getMetadata() != null); - } - - /** Delete document is successful. */ - @Ignore - @Test - public void deleteDocumentIsSuccessful() { - DocumentAccepted createResponse = createTestDocument(collectionId); - String documentId = createResponse.getDocumentId(); - - WaitFor.Condition documentAccepted = - new WaitForDocumentAccepted(environmentId, collectionId, documentId); - WaitFor.waitFor(documentAccepted, 5, TimeUnit.SECONDS, 500); - - DeleteDocumentOptions deleteOptions = - new DeleteDocumentOptions.Builder(environmentId, collectionId, documentId).build(); - discovery.deleteDocument(deleteOptions).execute(); - } - - /** Gets the document is successful. */ - @Ignore - @Test - public void getDocumentIsSuccessful() { - DocumentAccepted documentAccepted = createTestDocument(collectionId); - - GetDocumentStatusOptions getOptions = - new GetDocumentStatusOptions.Builder( - environmentId, collectionId, documentAccepted.getDocumentId()) - .build(); - DocumentStatus getResponse = discovery.getDocumentStatus(getOptions).execute().getResult(); - - assertEquals(DocumentStatus.Status.AVAILABLE, getResponse.getStatus()); - } - - /** Update document is successful. */ - @Test - public void updateDocumentIsSuccessful() { - DocumentAccepted documentAccepted = createTestDocument(collectionId); - - uniqueName = UUID.randomUUID().toString(); - String myDocumentJson = "{\"field\":\"value2\"}"; - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - UpdateDocumentOptions.Builder updateBuilder = - new UpdateDocumentOptions.Builder( - environmentId, collectionId, documentAccepted.getDocumentId()); - updateBuilder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - updateBuilder.filename(UUID.randomUUID().toString()); - DocumentAccepted updateResponse = - discovery.updateDocument(updateBuilder.build()).execute().getResult(); - - GetDocumentStatusOptions getOptions = - new GetDocumentStatusOptions.Builder( - environmentId, collectionId, updateResponse.getDocumentId()) - .build(); - DocumentStatus getResponse = discovery.getDocumentStatus(getOptions).execute().getResult(); - - assertNotNull(getResponse); - } - - /** Update another document is successful. */ - @Test - public void updateAnotherDocumentIsSuccessful() { - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.metadata(myMetadata.toString()); - DocumentAccepted documentAccepted = - discovery.addDocument(builder.build()).execute().getResult(); - - String myDocumentJson = "{\"field\":\"value2\"}"; - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - UpdateDocumentOptions.Builder updateBuilder = - new UpdateDocumentOptions.Builder( - environmentId, collectionId, documentAccepted.getDocumentId()); - updateBuilder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - updateBuilder.filename(UUID.randomUUID().toString()); - DocumentAccepted updateResponse = - discovery.updateDocument(updateBuilder.build()).execute().getResult(); - - GetDocumentStatusOptions getOptions = - new GetDocumentStatusOptions.Builder( - environmentId, collectionId, updateResponse.getDocumentId()) - .build(); - DocumentStatus getResponse = discovery.getDocumentStatus(getOptions).execute().getResult(); - - assertNotNull(getResponse); - } - - /** Update document with metadata is successful. */ - @Test - @Ignore("Pending implementation of 'processing' after document update") - public void updateDocumentWithMetadataIsSuccessful() { - Collection collection = createTestCollection(); - String collectionId = collection.getCollectionId(); - DocumentAccepted documentAccepted = createTestDocument(collectionId); - - String myDocumentJson = "{\"field\":\"value2\"}"; - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - - UpdateDocumentOptions.Builder updateBuilder = - new UpdateDocumentOptions.Builder( - environmentId, collectionId, documentAccepted.getDocumentId()); - updateBuilder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - updateBuilder.metadata(myMetadata.toString()); - DocumentAccepted updateResponse = - discovery.updateDocument(updateBuilder.build()).execute().getResult(); - - WaitFor.Condition waitForDocumentAccepted = - new WaitForDocumentAccepted(environmentId, collectionId, updateResponse.getDocumentId()); - WaitFor.waitFor(waitForDocumentAccepted, 5, TimeUnit.SECONDS, 500); - - QueryOptions queryOptions = new QueryOptions.Builder(environmentId, collectionId).build(); - QueryResponse queryResponse = discovery.query(queryOptions).execute().getResult(); - - assertTrue(queryResponse.getResults().get(0).getMetadata() != null); - } - - /** Gets the collection fields is successful. */ - @Ignore - @Test - public void getCollectionFieldsIsSuccessful() { - ListCollectionFieldsOptions getOptions = - new ListCollectionFieldsOptions.Builder(environmentId, collectionId).build(); - ListCollectionFieldsResponse getResponse = - discovery.listCollectionFields(getOptions).execute().getResult(); - - assertFalse(getResponse.getFields().isEmpty()); - } - - // query tests - - /** Query with count is successful. */ - @Test - public void queryWithCountIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.count(5L); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - assertTrue(queryResponse.getMatchingResults() > 0); - } - - /** Query with offset is successful. */ - @Test - public void queryWithOffsetIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.offset(5L); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - assertTrue(queryResponse.getMatchingResults() > 0); - } - - /** Query with query is successful. */ - @Ignore - @Test - public void queryWithQueryIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.query("field" + Operator.CONTAINS + 1); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - assertEquals(new Long(1), queryResponse.getMatchingResults()); - assertEquals(1, queryResponse.getResults().size()); - } - - /** Query with filter is successful. */ - @Test - public void queryWithFilterIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.filter("field" + Operator.CONTAINS + 1); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - assertEquals(new Long(1), queryResponse.getMatchingResults()); - assertEquals(1, queryResponse.getResults().size()); - } - - /** Query with sort is successful. */ - @Test - public void queryWithSortIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - String sortList = "field"; - queryBuilder.sort(sortList); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - assertTrue(queryResponse.getResults().size() > 1); - int v0 = ((LazilyParsedNumber) queryResponse.getResults().get(0).get("field")).intValue(); - int v1 = ((LazilyParsedNumber) queryResponse.getResults().get(1).get("field")).intValue(); - assertTrue(v0 <= v1); - } - - /** Query with aggregation term is successful. */ - @Test - public void queryWithAggregationTermIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.TERM); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.AND); - sb.append(10L); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryTermAggregation term = (QueryTermAggregation) queryResponse.getAggregations().get(0); - assertEquals(1, queryResponse.getAggregations().size()); - assertEquals(new Long(10), term.getCount()); - } - - /** - * Query with aggregation histogram is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationHistogramIsSuccessful() throws InterruptedException { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.HISTOGRAM); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.AND); - sb.append(5L); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryHistogramAggregation histogram = - (QueryHistogramAggregation) queryResponse.getAggregations().get(0); - Long interval = histogram.getInterval(); - assertEquals(new Long(5), interval); - assertEquals(2, histogram.getResults().size()); - } - - /** - * Query with aggregation maximum is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationMaximumIsSuccessful() throws InterruptedException { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.MAX); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryCalculationAggregation max = - (QueryCalculationAggregation) queryResponse.getAggregations().get(0); - assertEquals(AggregationType.MAX.getName(), max.getType()); - assertEquals(new Double(9), max.getValue()); - } - - /** - * Query with aggregation minimum is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationMinimumIsSuccessful() throws InterruptedException { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.MIN); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryCalculationAggregation min = - (QueryCalculationAggregation) queryResponse.getAggregations().get(0); - assertEquals(AggregationType.MIN.getName(), min.getType()); - assertEquals(new Double(0), min.getValue()); - } - - /** - * Query with aggregation summation is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationSummationIsSuccessful() throws InterruptedException { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.SUM); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryCalculationAggregation sum = - (QueryCalculationAggregation) queryResponse.getAggregations().get(0); - assertEquals(AggregationType.SUM.getName(), sum.getType()); - assertEquals(new Double(45), sum.getValue()); - } - - /** - * Query with aggregation average is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationAverageIsSuccessful() throws InterruptedException { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.AVERAGE); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryCalculationAggregation avg = - (QueryCalculationAggregation) queryResponse.getAggregations().get(0); - assertEquals(AggregationType.AVERAGE.getName(), avg.getType()); - assertEquals(new Double(4.5), avg.getValue()); - } - - /** Query with aggregation filter is successful. */ - @Test - public void queryWithAggregationFilterIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.FILTER); - sb.append(Operator.OPENING_GROUPING); - sb.append("field:9"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryFilterAggregation filter = (QueryFilterAggregation) queryResponse.getAggregations().get(0); - assertEquals(AggregationType.FILTER.getName(), filter.getType()); - assertEquals("field:9", filter.getMatch()); - assertEquals(new Long(1), filter.getMatchingResults()); - } - - /** - * Query with aggregation nested is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationNestedIsSuccessful() throws InterruptedException { - DocumentAccepted testDocument = createNestedTestDocument(collectionId); - String documentId = testDocument.getDocumentId(); - - WaitFor.Condition documentAccepted = - new WaitForDocumentAccepted(environmentId, collectionId, documentId); - WaitFor.waitFor(documentAccepted, 5, TimeUnit.SECONDS, 500); - - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.NESTED); - sb.append(Operator.OPENING_GROUPING); - sb.append("nested_fields"); - sb.append(Operator.CLOSING_GROUPING); - sb.append(Operator.NEST_AGGREGATION); - sb.append(AggregationType.TERM); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - assertNotNull(queryResponse.getAggregations()); - } - - /** - * Query with aggregation timeslice is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationTimesliceIsSuccessful() throws InterruptedException { - String myDocumentJson = "{\"time\":\"1999-02-16T00:00:00.000-05:00\"}"; - DocumentAccepted testDocument1 = - createTestDocument(myDocumentJson, UUID.randomUUID().toString(), collectionId); - String documentId1 = testDocument1.getDocumentId(); - myDocumentJson = "{\"time\":\"1999-04-16T00:00:00.000-05:00\"}"; - DocumentAccepted testDocument2 = - createTestDocument(myDocumentJson, UUID.randomUUID().toString(), collectionId); - String documentId2 = testDocument2.getDocumentId(); - - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.TIMESLICE); - sb.append(Operator.OPENING_GROUPING); - sb.append("time,1day,EST"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - - GetDocumentStatusOptions getOptions1 = - new GetDocumentStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .documentId(documentId1) - .build(); - DocumentStatus status1 = discovery.getDocumentStatus(getOptions1).execute().getResult(); - GetDocumentStatusOptions getOptions2 = - new GetDocumentStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .documentId(documentId2) - .build(); - DocumentStatus status2 = discovery.getDocumentStatus(getOptions2).execute().getResult(); - while (status1.getStatus().equals(DocumentAccepted.Status.PROCESSING) - || status2.getStatus().equals(DocumentAccepted.Status.PROCESSING)) { - Thread.sleep(3000); - status1 = discovery.getDocumentStatus(getOptions1).execute().getResult(); - status2 = discovery.getDocumentStatus(getOptions2).execute().getResult(); - } - - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryTimesliceAggregation timeslice = - (QueryTimesliceAggregation) queryResponse.getAggregations().get(0); - assertEquals(AggregationType.TIMESLICE.getName(), timeslice.getType()); - assertNotNull(timeslice.getResults()); - } - - /** Query with aggregation top hits is successful. */ - @Test - public void queryWithAggregationTopHitsIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.TERM); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - sb.append(Operator.NEST_AGGREGATION); - sb.append(AggregationType.TOP_HITS); - sb.append(Operator.OPENING_GROUPING); - sb.append("3"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryTermAggregation term = (QueryTermAggregation) queryResponse.getAggregations().get(0); - QueryTopHitsAggregation topHits = - (QueryTopHitsAggregation) term.getResults().get(0).getAggregations().get(0); - assertEquals(new Long(3), topHits.getSize()); - assertNotNull(topHits.getHits()); - } - - /** Query with aggregation unique count is successful. */ - public void queryWithAggregationUniqueCountIsSuccessful() { - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.UNIQUE_COUNT); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - QueryCalculationAggregation uniqueCount = - (QueryCalculationAggregation) queryResponse.getAggregations().get(0); - assertEquals(new Double(10), uniqueCount.getValue()); - } - - /** - * Query with passages is successful. - * - * @throws InterruptedException the interrupted exception - * @throws FileNotFoundException the file not found exception - */ - @Test - public void queryWithPassagesIsSuccessful() throws InterruptedException, FileNotFoundException { - createTestDocument( - getStringFromInputStream(new FileInputStream(PASSAGES_TEST_FILE_1)), - UUID.randomUUID().toString(), - collectionId); - createTestDocument( - getStringFromInputStream(new FileInputStream(PASSAGES_TEST_FILE_2)), - UUID.randomUUID().toString(), - collectionId); - - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.passages(true); - queryBuilder.naturalLanguageQuery("Watson"); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - List passages = queryResponse.getPassages(); - assertNotNull(passages); - } - - // queryNotices tests - - /** Query notices count is successful. */ - @Test - public void queryNoticesCountIsSuccessful() { - QueryNoticesOptions.Builder queryBuilder = - new QueryNoticesOptions.Builder(environmentId, collectionId); - queryBuilder.count(5L); - QueryNoticesResponse queryResponse = - discovery.queryNotices(queryBuilder.build()).execute().getResult(); - assertTrue(queryResponse.getResults().size() <= 5); - } - - // Tests for reported issues - - /** Issue number 517. */ - @Test - public void issueNumber517() { - String uniqueConfigName = uniqueName + "-config"; - CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(); - createBuilder.environmentId(environmentId); - Configuration configuration = getTestConfiguration(DISCOVERY1_TEST_CONFIG_FILE); - - configuration = configuration.newBuilder().name(uniqueConfigName).build(); - createBuilder.configuration(configuration); - Configuration createResponse = createConfiguration(createBuilder.build()); - - GetConfigurationOptions getOptions = - new GetConfigurationOptions.Builder(environmentId, createResponse.configurationId()) - .build(); - Configuration getResponse = discovery.getConfiguration(getOptions).execute().getResult(); - - // returned config should have some json data - assertEquals(1, getResponse.conversions().jsonNormalizations().size()); - } - - /** Issue number 518. */ - @Test - public void issueNumber518() { - String[] operations = - new String[] { - Operation.MOVE, Operation.COPY, Operation.MERGE, Operation.REMOVE, Operation.REMOVE_NULLS - }; - - String uniqueConfigName = uniqueName + "-config"; - CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(); - createBuilder.environmentId(environmentId); - Configuration configuration = getTestConfiguration(DISCOVERY2_TEST_CONFIG_FILE); - - configuration = configuration.newBuilder().name(uniqueConfigName).build(); - createBuilder.configuration(configuration); - Configuration createResponse = createConfiguration(createBuilder.build()); - - GetConfigurationOptions getOptions = - new GetConfigurationOptions.Builder(environmentId, createResponse.configurationId()) - .build(); - Configuration getResponse = discovery.getConfiguration(getOptions).execute().getResult(); - - // verify getResponse deserializes the operations appropriately - for (NormalizationOperation normalization : getResponse.normalizations()) { - String operation = normalization.operation(); - assertEquals(true, Arrays.asList(operations).contains(operation)); - } - } - - /** Issue number 654. */ - @Test - public void issueNumber654() { - String collectionId = setupTestDocuments(); - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.query("field:1|3"); - QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult(); - - assertEquals(new Long(2), queryResponse.getMatchingResults()); - assertEquals(2, queryResponse.getResults().size()); - } - - /** Issue number 659. */ - /* Issue 659: creating a collection does not use the configuration id */ - @Test - public void issueNumber659() { - String uniqueConfigName = UUID.randomUUID().toString() + "-config"; - CreateConfigurationOptions configOptions = - new CreateConfigurationOptions.Builder() - .environmentId(environmentId) - .name(uniqueConfigName) - .build(); - Configuration configuration = - discovery.createConfiguration(configOptions).execute().getResult(); - configurationIds.add(configuration.configurationId()); - - String uniqueCollectionName = UUID.randomUUID().toString() + "-collection"; - CreateCollectionOptions collectionOptions = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(configuration.configurationId()) - .build(); - Collection collection = discovery.createCollection(collectionOptions).execute().getResult(); - collectionIds.add(collection.getCollectionId()); - - assertEquals(collection.getConfigurationId(), configuration.configurationId()); - } - - /** Adds the training data is successful. */ - @Test - public void addTrainingDataIsSuccessful() { - AddTrainingDataOptions.Builder builder = - new AddTrainingDataOptions.Builder(environmentId, collectionId); - String naturalLanguageQuery = "Example query" + UUID.randomUUID().toString(); - builder.naturalLanguageQuery(naturalLanguageQuery); - String documentId = createTestDocument(collectionId).getDocumentId(); - int relevance = 0; - TrainingExample example = - new TrainingExample.Builder().documentId(documentId).relevance(relevance).build(); - builder.addExamples(example); - TrainingQuery response = discovery.addTrainingData(builder.build()).execute().getResult(); - - assertFalse(response.getQueryId().isEmpty()); - assertEquals(response.getNaturalLanguageQuery(), naturalLanguageQuery); - assertTrue(response.getFilter().isEmpty()); - assertEquals(response.getExamples().size(), 1); - - TrainingExample returnedExample = response.getExamples().get(0); - assertEquals(returnedExample.documentId(), documentId); - assertTrue(returnedExample.crossReference().isEmpty()); - assertEquals(returnedExample.relevance(), new Long(relevance)); - } - - /** Adds the training example is successful. */ - @Test - public void addTrainingExampleIsSuccessful() { - TrainingQuery query = createTestQuery(collectionId, "Query" + UUID.randomUUID().toString()); - int startingExampleCount = query.getExamples().size(); - String queryId = query.getQueryId(); - - String documentId = "document_id"; - String crossReference = "cross_reference"; - int relevance = 50; - CreateTrainingExampleOptions.Builder exampleBuilder = - new CreateTrainingExampleOptions.Builder(environmentId, collectionId, queryId); - exampleBuilder.documentId(documentId); - exampleBuilder.crossReference(crossReference); - exampleBuilder.relevance(relevance); - discovery.createTrainingExample(exampleBuilder.build()).execute().getResult(); - - GetTrainingDataOptions.Builder queryBuilder = - new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId); - TrainingQuery updatedQuery = - discovery.getTrainingData(queryBuilder.build()).execute().getResult(); - - assertTrue(updatedQuery.getExamples().size() > startingExampleCount); - TrainingExample newExample = updatedQuery.getExamples().get(0); - assertEquals(newExample.documentId(), documentId); - assertEquals(newExample.crossReference(), crossReference); - assertEquals(newExample.relevance(), new Long(relevance)); - } - - /** Delete all collection training data is successful. */ - @Test - public void deleteAllCollectionTrainingDataIsSuccessful() { - String collId = setupTestQueries(collectionId); - DeleteAllTrainingDataOptions.Builder deleteBuilder = - new DeleteAllTrainingDataOptions.Builder(environmentId, collId); - discovery.deleteAllTrainingData(deleteBuilder.build()).execute(); - - ListTrainingDataOptions.Builder listBuilder = - new ListTrainingDataOptions.Builder(environmentId, collId); - TrainingDataSet trainingData = - discovery.listTrainingData(listBuilder.build()).execute().getResult(); - - assertEquals(trainingData.getQueries().size(), 0); - } - - /** Delete training data query is successful. */ - @Test - public void deleteTrainingDataQueryIsSuccessful() { - TrainingQuery query = createTestQuery(collectionId, "Query" + UUID.randomUUID().toString()); - String queryId = query.getQueryId(); - - ListTrainingDataOptions.Builder listBuilder = - new ListTrainingDataOptions.Builder(environmentId, collectionId); - TrainingDataSet trainingData = - discovery.listTrainingData(listBuilder.build()).execute().getResult(); - List queryList = trainingData.getQueries(); - boolean doesQueryExist = false; - for (TrainingQuery q : queryList) { - if (q.getQueryId().equals(queryId)) { - doesQueryExist = true; - break; - } - } - assertTrue(doesQueryExist); - - DeleteTrainingDataOptions.Builder deleteBuilder = - new DeleteTrainingDataOptions.Builder(environmentId, collectionId, queryId); - discovery.deleteTrainingData(deleteBuilder.build()).execute(); - - listBuilder = new ListTrainingDataOptions.Builder(environmentId, collectionId); - trainingData = discovery.listTrainingData(listBuilder.build()).execute().getResult(); - queryList = trainingData.getQueries(); - doesQueryExist = false; - for (TrainingQuery q : queryList) { - if (q.getQueryId().equals(queryId)) { - doesQueryExist = true; - break; - } - } - assertFalse(doesQueryExist); - } - - /** Delete training data example is successful. */ - @Test - public void deleteTrainingDataExampleIsSuccessful() { - TrainingQuery newQuery = createTestQuery(collectionId, "Query" + UUID.randomUUID().toString()); - String queryId = newQuery.getQueryId(); - - String documentId = "document_id"; - String crossReference = "cross_reference"; - int relevance = 50; - CreateTrainingExampleOptions.Builder exampleBuilder = - new CreateTrainingExampleOptions.Builder(environmentId, collectionId, queryId); - exampleBuilder.documentId(documentId); - exampleBuilder.crossReference(crossReference); - exampleBuilder.relevance(relevance); - TrainingExample createdExample = - discovery.createTrainingExample(exampleBuilder.build()).execute().getResult(); - String exampleId = createdExample.documentId(); - - GetTrainingDataOptions.Builder queryBuilder = - new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId); - TrainingQuery queryWithAddedExample = - discovery.getTrainingData(queryBuilder.build()).execute().getResult(); - int startingCount = queryWithAddedExample.getExamples().size(); - - DeleteTrainingExampleOptions.Builder deleteBuilder = - new DeleteTrainingExampleOptions.Builder(environmentId, collectionId, queryId, exampleId); - discovery.deleteTrainingExample(deleteBuilder.build()).execute(); - - GetTrainingDataOptions.Builder newQueryBuilder = - new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId); - TrainingQuery queryWithDeletedExample = - discovery.getTrainingData(newQueryBuilder.build()).execute().getResult(); - - assertTrue(startingCount > queryWithDeletedExample.getExamples().size()); - } - - /** Gets the training data is successful. */ - @Test - public void getTrainingDataIsSuccessful() { - String naturalLanguageQuery = "Query" + UUID.randomUUID().toString(); - TrainingQuery newQuery = createTestQuery(collectionId, naturalLanguageQuery); - String queryId = newQuery.getQueryId(); - - GetTrainingDataOptions.Builder queryBuilder = - new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId); - TrainingQuery queryResponse = - discovery.getTrainingData(queryBuilder.build()).execute().getResult(); - - assertEquals(queryResponse.getNaturalLanguageQuery(), naturalLanguageQuery); - } - - /** Gets the training example is successful. */ - @Test - public void getTrainingExampleIsSuccessful() { - AddTrainingDataOptions.Builder builder = - new AddTrainingDataOptions.Builder(environmentId, collectionId); - String naturalLanguageQuery = "Query" + UUID.randomUUID().toString(); - builder.naturalLanguageQuery(naturalLanguageQuery); - String documentId = "Document" + UUID.randomUUID().toString(); - int relevance = 0; - TrainingExample example = - new TrainingExample.Builder().documentId(documentId).relevance(relevance).build(); - builder.addExamples(example); - TrainingQuery response = discovery.addTrainingData(builder.build()).execute().getResult(); - String queryId = response.getQueryId(); - - GetTrainingExampleOptions.Builder getExampleBuilder = - new GetTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId); - TrainingExample returnedExample = - discovery.getTrainingExample(getExampleBuilder.build()).execute().getResult(); - - assertEquals(returnedExample.documentId(), documentId); - } - - /** Update training example is successful. */ - @Test - public void updateTrainingExampleIsSuccessful() { - AddTrainingDataOptions.Builder builder = - new AddTrainingDataOptions.Builder(environmentId, collectionId); - String naturalLanguageQuery = "Query" + UUID.randomUUID().toString(); - builder.naturalLanguageQuery(naturalLanguageQuery); - String documentId = "Document" + UUID.randomUUID().toString(); - int relevance = 0; - TrainingExample example = - new TrainingExample.Builder().documentId(documentId).relevance(relevance).build(); - builder.addExamples(example); - TrainingQuery response = discovery.addTrainingData(builder.build()).execute().getResult(); - String queryId = response.getQueryId(); - - UpdateTrainingExampleOptions.Builder updateBuilder = - new UpdateTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId); - String newCrossReference = "cross_reference"; - updateBuilder.crossReference(newCrossReference); - int newRelevance = 50; - updateBuilder.relevance(newRelevance); - TrainingExample updatedExample = - discovery.updateTrainingExample(updateBuilder.build()).execute().getResult(); - - assertEquals(updatedExample.crossReference(), newCrossReference); - assertEquals(updatedExample.relevance(), new Long(newRelevance)); - } - - /** Expansions operations are successful. */ - @Test - public void expansionsOperationsAreSuccessful() { - List expansion1InputTerms = Arrays.asList("weekday", "week day"); - List expansion1ExpandedTerms = - Arrays.asList("monday", "tuesday", "wednesday", "thursday", "friday"); - List expansion2InputTerms = Arrays.asList("weekend", "week end"); - List expansion2ExpandedTerms = Arrays.asList("saturday", "sunday"); - Expansion expansion1 = - new Expansion.Builder() - .inputTerms(expansion1InputTerms) - .expandedTerms(expansion1ExpandedTerms) - .build(); - Expansion expansion2 = - new Expansion.Builder() - .inputTerms(expansion2InputTerms) - .expandedTerms(expansion2ExpandedTerms) - .build(); - Expansions expansions = - new Expansions.Builder().expansions(Arrays.asList(expansion1, expansion2)).build(); - CreateExpansionsOptions createOptions = - new CreateExpansionsOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .expansions(expansions) - .build(); - try { - Expansions createResults = discovery.createExpansions(createOptions).execute().getResult(); - assertEquals(createResults.expansions().size(), 2); - assertEquals(createResults.expansions().get(0).inputTerms(), expansion1InputTerms); - assertEquals(createResults.expansions().get(0).expandedTerms(), expansion1ExpandedTerms); - assertEquals(createResults.expansions().get(1).inputTerms(), expansion2InputTerms); - assertEquals(createResults.expansions().get(1).expandedTerms(), expansion2ExpandedTerms); - - ListExpansionsOptions listOptions = - new ListExpansionsOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - Expansions listResults = discovery.listExpansions(listOptions).execute().getResult(); - - assertEquals(listResults.expansions().size(), 2); - - DeleteExpansionsOptions deleteOptions = - new DeleteExpansionsOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - discovery.deleteExpansions(deleteOptions).execute(); - - Expansions emptyListResults = discovery.listExpansions(listOptions).execute().getResult(); - - assertTrue( - emptyListResults.expansions().get(0).inputTerms() == null - || emptyListResults.expansions().get(0).inputTerms().isEmpty()); - assertTrue( - emptyListResults.expansions().get(0).expandedTerms() == null - || emptyListResults.expansions().get(0).expandedTerms().get(0).isEmpty()); - } catch (InternalServerErrorException e) { - /** - * System.out.println( "Internal server error while trying to create expansion ¯\\_(ツ)_/¯ - * Probably not our issue" + " but may be worth looking into."); * - */ - e.printStackTrace(); - } - } - - /** Delete user data is successful. */ - @Test - public void deleteUserDataIsSuccessful() { - String customerId = "java_sdk_test_id"; - - try { - DeleteUserDataOptions deleteOptions = - new DeleteUserDataOptions.Builder().customerId(customerId).build(); - discovery.deleteUserData(deleteOptions).execute(); - } catch (Exception ex) { - fail(ex.getMessage()); - } - } - - /** Credentials operations are successful. */ - @Test - public void credentialsOperationsAreSuccessful() { - String url = "https://login.salesforce.com"; - String username = "test@username.com"; - String password = "test_password"; // pragma: whitelist secret - CredentialDetails credentialDetails = - new CredentialDetails.Builder() - .credentialType(CredentialDetails.CredentialType.USERNAME_PASSWORD) - .url(url) - .username(username) - .password(password) - .build(); - Credentials credentials = - new Credentials.Builder() - .sourceType(Credentials.SourceType.SALESFORCE) - .credentialDetails(credentialDetails) - .build(); - - CreateCredentialsOptions createOptions = - new CreateCredentialsOptions.Builder() - .environmentId(environmentId) - .credentials(credentials) - .build(); - Credentials createdCredentials = - discovery.createCredentials(createOptions).execute().getResult(); - String credentialId = createdCredentials.credentialId(); - - // Create assertions - assertEquals(Credentials.SourceType.SALESFORCE, createdCredentials.sourceType()); - assertEquals( - CredentialDetails.CredentialType.USERNAME_PASSWORD, - createdCredentials.credentialDetails().credentialType()); - assertEquals(url, createdCredentials.credentialDetails().url()); - assertEquals(username, createdCredentials.credentialDetails().username()); - - String newUrl = "https://newlogin.salesforce.com"; - CredentialDetails updatedDetails = - new CredentialDetails.Builder() - .credentialType(CredentialDetails.CredentialType.USERNAME_PASSWORD) - .url(newUrl) - .username(username) - .password(password) - .build(); - - UpdateCredentialsOptions updateOptions = - new UpdateCredentialsOptions.Builder() - .environmentId(environmentId) - .credentialId(credentialId) - .sourceType(Credentials.SourceType.SALESFORCE) - .credentialDetails(updatedDetails) - .build(); - Credentials updatedCredentials = - discovery.updateCredentials(updateOptions).execute().getResult(); - - // Update assertion - assertEquals(newUrl, updatedCredentials.credentialDetails().url()); - - GetCredentialsOptions getOptions = - new GetCredentialsOptions.Builder() - .environmentId(environmentId) - .credentialId(credentialId) - .build(); - Credentials retrievedCredentials = discovery.getCredentials(getOptions).execute().getResult(); - - // Get assertions - assertEquals(Credentials.SourceType.SALESFORCE, retrievedCredentials.sourceType()); - assertEquals( - CredentialDetails.CredentialType.USERNAME_PASSWORD, - retrievedCredentials.credentialDetails().credentialType()); - assertEquals(newUrl, retrievedCredentials.credentialDetails().url()); - assertEquals(username, retrievedCredentials.credentialDetails().username()); - - ListCredentialsOptions listOptions = - new ListCredentialsOptions.Builder().environmentId(environmentId).build(); - CredentialsList credentialsList = discovery.listCredentials(listOptions).execute().getResult(); - - // List assertion - assertTrue(!credentialsList.getCredentials().isEmpty()); - - DeleteCredentialsOptions deleteOptions = - new DeleteCredentialsOptions.Builder() - .environmentId(environmentId) - .credentialId(credentialId) - .build(); - discovery.deleteCredentials(deleteOptions).execute(); - } - - /** Creates the event is successful. */ - @Test - public void createEventIsSuccessful() { - // create test document - DocumentAccepted accepted = createTestDocument(collectionId); - - // make query to get session_token - QueryOptions queryOptions = - new QueryOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .naturalLanguageQuery("field number 1") - .build(); - QueryResponse queryResponse = discovery.query(queryOptions).execute().getResult(); - String sessionToken = queryResponse.getSessionToken(); - - // make createEvent call - EventData eventData = - new EventData.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .documentId(accepted.getDocumentId()) - .sessionToken(sessionToken) - .build(); - CreateEventOptions createEventOptions = - new CreateEventOptions.Builder() - .type(CreateEventOptions.Type.CLICK) - .data(eventData) - .build(); - CreateEventResponse response = discovery.createEvent(createEventOptions).execute().getResult(); - - assertNotNull(response); - } - - /** Query log is successful. */ - // @Test - public void queryLogIsSuccessful() { - LogQueryResponse response = discovery.queryLog().execute().getResult(); - assertNotNull(response); - } - - /** Gets the metrics event rate is successful. */ - // @Test - public void getMetricsEventRateIsSuccessful() { - MetricResponse response = discovery.getMetricsEventRate().execute().getResult(); - assertNotNull(response); - } - - /** Gets the metrics query is successful. */ - // @Test - public void getMetricsQueryIsSuccessful() { - MetricResponse response = discovery.getMetricsQuery().execute().getResult(); - assertNotNull(response); - } - - /** Gets the metrics query event is successful. */ - // @Test - public void getMetricsQueryEventIsSuccessful() { - MetricResponse response = discovery.getMetricsQueryEvent().execute().getResult(); - assertNotNull(response); - } - - /** Gets the metrics query no results is successful. */ - // @Test - public void getMetricsQueryNoResultsIsSuccessful() { - MetricResponse response = discovery.getMetricsQueryNoResults().execute().getResult(); - assertNotNull(response); - } - - /** Gets the metrics query token event is successful. */ - // @Test - public void getMetricsQueryTokenEventIsSuccessful() { - MetricTokenResponse response = discovery.getMetricsQueryTokenEvent().execute().getResult(); - assertNotNull(response); - } - - /** - * Tokenization dictionary operations are successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void tokenizationDictionaryOperationsAreSuccessful() throws InterruptedException { - // create collection first because creating a tokenization dictionary currently is only - // supported in Japanese - // collections - CreateCollectionOptions createCollectionOptions = - new CreateCollectionOptions.Builder() - .environmentId(environmentId) - .name("tokenization-dict-testing-collection " + UUID.randomUUID().toString()) - .language(CreateCollectionOptions.Language.JA) - .build(); - Collection tokenDictTestCollection = - discovery.createCollection(createCollectionOptions).execute().getResult(); - String testCollectionId = tokenDictTestCollection.getCollectionId(); - - // System.out.println("Test collection created!"); - - try { - TokenDictRule tokenDictRule = - new TokenDictRule.Builder() - .text("token") - .partOfSpeech("noun") - .readings(Arrays.asList("reading_1", "reading_2")) - .tokens(Arrays.asList("token_1", "token_2")) - .build(); - - // the service doesn't seem to like when we try and move too fast - Thread.sleep(5000); - - // test creating tokenization dictionary - CreateTokenizationDictionaryOptions createOptions = - new CreateTokenizationDictionaryOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .addTokenizationRules(tokenDictRule) - .build(); - TokenDictStatusResponse createResponse = - discovery.createTokenizationDictionary(createOptions).execute().getResult(); - assertNotNull(createResponse); - - // test getting tokenization dictionary - GetTokenizationDictionaryStatusOptions getOptions = - new GetTokenizationDictionaryStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .build(); - TokenDictStatusResponse getResponse = - discovery.getTokenizationDictionaryStatus(getOptions).execute().getResult(); - assertNotNull(getResponse); - - Thread.sleep(5000); - - // test deleting tokenization dictionary - DeleteTokenizationDictionaryOptions deleteOptions = - new DeleteTokenizationDictionaryOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .build(); - discovery.deleteTokenizationDictionary(deleteOptions).execute(); - } catch (BadRequestException ex) { - // this most likely means the environment wasn't ready to handle another tokenization file - - // this is fine - // System.out.println("Service wasn't ready yet! Error: " + ex.getMessage()); - } finally { - // delete test collection - DeleteCollectionOptions deleteCollectionOptions = - new DeleteCollectionOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .build(); - discovery.deleteCollection(deleteCollectionOptions).execute(); - - // System.out.println("Test collection deleted"); - } - } - - /** - * Stopword list operations are successful. - * - * @throws FileNotFoundException the file not found exception - * @throws InterruptedException the interrupted exception - */ - @Test - public void stopwordListOperationsAreSuccessful() - throws FileNotFoundException, InterruptedException { - CreateCollectionOptions createCollectionOptions = - new CreateCollectionOptions.Builder() - .environmentId(environmentId) - .name("stopword-list-testing-collection " + UUID.randomUUID().toString()) - .language(CreateCollectionOptions.Language.EN) - .build(); - Collection tokenDictTestCollection = - discovery.createCollection(createCollectionOptions).execute().getResult(); - String testCollectionId = tokenDictTestCollection.getCollectionId(); - // System.out.println("Test collection created!"); - - try { - CreateStopwordListOptions createStopwordListOptions = - new CreateStopwordListOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .stopwordFile(new FileInputStream(STOPWORDS_TEST_FILE)) - .stopwordFilename("test_stopword_file") - .build(); - TokenDictStatusResponse createResponse = - discovery.createStopwordList(createStopwordListOptions).execute().getResult(); - assertEquals("stopwords", createResponse.getType()); - - GetStopwordListStatusOptions getStopwordListStatusOptions = - new GetStopwordListStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .build(); - TokenDictStatusResponse getResponse = - discovery.getStopwordListStatus(getStopwordListStatusOptions).execute().getResult(); - assertEquals("stopwords", getResponse.getType()); - - DeleteStopwordListOptions deleteStopwordListOptions = - new DeleteStopwordListOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .build(); - discovery.deleteStopwordList(deleteStopwordListOptions).execute(); - } catch (BadRequestException ex) { - // this most likely means the environment wasn't ready to handle another stopwords file - this - // is fine - // System.out.println("Service wasn't ready yet! Error: " + ex.getMessage()); - } finally { - DeleteCollectionOptions deleteCollectionOptions = - new DeleteCollectionOptions.Builder() - .environmentId(environmentId) - .collectionId(testCollectionId) - .build(); - discovery.deleteCollection(deleteCollectionOptions).execute(); - // System.out.println("Test collection deleted"); - } - } - - /** Gateway operations are successful. */ - @Test - public void gatewayOperationsAreSuccessful() { - String gatewayName = "java-sdk-test-gateway"; - - ListGatewaysOptions listGatewaysOptions = - new ListGatewaysOptions.Builder().environmentId(environmentId).build(); - GatewayList gatewayList = discovery.listGateways(listGatewaysOptions).execute().getResult(); - assertNotNull(gatewayList); - int originalListSize = gatewayList.getGateways().size(); - - CreateGatewayOptions createGatewayOptions = - new CreateGatewayOptions.Builder().environmentId(environmentId).name(gatewayName).build(); - Gateway gatewayResponse = discovery.createGateway(createGatewayOptions).execute().getResult(); - assertNotNull(gatewayResponse); - assertEquals(gatewayName, gatewayResponse.getName()); - String testGatewayId = gatewayResponse.getGatewayId(); - - gatewayList = discovery.listGateways(listGatewaysOptions).execute().getResult(); - assertTrue(gatewayList.getGateways().size() > originalListSize); - - GetGatewayOptions getGatewayOptions = - new GetGatewayOptions.Builder() - .environmentId(environmentId) - .gatewayId(testGatewayId) - .build(); - Gateway getGatewayResponse = discovery.getGateway(getGatewayOptions).execute().getResult(); - assertNotNull(getGatewayResponse); - assertEquals(gatewayName, getGatewayResponse.getName()); - - DeleteGatewayOptions deleteGatewayOptions = - new DeleteGatewayOptions.Builder() - .environmentId(environmentId) - .gatewayId(testGatewayId) - .build(); - discovery.deleteGateway(deleteGatewayOptions).execute(); - } - - private Environment createEnvironment(CreateEnvironmentOptions createOptions) { - return discovery.createEnvironment(createOptions).execute().getResult(); - } - - private void deleteEnvironment(DeleteEnvironmentOptions deleteOptions) { - discovery.deleteEnvironment(deleteOptions).execute(); - } - - private Configuration createConfiguration(CreateConfigurationOptions createOptions) { - Configuration createResponse = - discovery.createConfiguration(createOptions).execute().getResult(); - configurationIds.add(createResponse.configurationId()); - return createResponse; - } - - private void deleteConfiguration(DeleteConfigurationOptions deleteOptions) { - discovery.deleteConfiguration(deleteOptions).execute(); - configurationIds.remove(deleteOptions.configurationId()); - } - - private Configuration createTestConfig() { - String uniqueConfigName = uniqueName + "-config"; - CreateConfigurationOptions.Builder createBuilder = - new CreateConfigurationOptions.Builder(environmentId, uniqueConfigName); - return createConfiguration(createBuilder.build()); - } - - private Collection createCollection(CreateCollectionOptions createOptions) { - Collection createResponse = discovery.createCollection(createOptions).execute().getResult(); - collectionIds.add(createResponse.getCollectionId()); - return createResponse; - } - - private void deleteCollection(DeleteCollectionOptions deleteOptions) { - discovery.deleteCollection(deleteOptions).execute(); - collectionIds.remove(deleteOptions.collectionId()); - } - - private Collection createTestCollection() { - Configuration createConfigResponse = createTestConfig(); - - String uniqueCollectionName = "java-sdk-" + uniqueName + "-collection"; - CreateCollectionOptions.Builder createCollectionBuilder = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(createConfigResponse.configurationId()); - return createCollection(createCollectionBuilder.build()); - } - - private DocumentAccepted createNestedTestDocument(String collectionId) { - String myDocumentJson = "{\"nested_fields\":{\"field\":\"value\"}}"; - return createTestDocument(myDocumentJson, UUID.randomUUID().toString(), collectionId); - } - - private DocumentAccepted createTestDocument(String collectionId) { - String myDocumentJson = "{\"field\":\"value\"}"; - return createTestDocument(myDocumentJson, UUID.randomUUID().toString(), collectionId); - } - - private DocumentAccepted createTestDocument(String filename, String collectionId) { - String myDocumentJson = "{\"field\":\"value\"}"; - return createTestDocument(myDocumentJson, filename, collectionId); - } - - @SuppressWarnings("deprecation") - private DocumentAccepted createTestDocument(String json, String filename, String collectionId) { - InputStream documentStream = new ByteArrayInputStream(json.getBytes()); - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename(filename); - DocumentAccepted createResponse = discovery.addDocument(builder.build()).execute().getResult(); - WaitFor.Condition documentAccepted = - new WaitForDocumentAccepted(environmentId, collectionId, createResponse.getDocumentId()); - WaitFor.waitFor(documentAccepted, 5, TimeUnit.SECONDS, 500); - return createResponse; - } - - private List createTestDocuments(String collectionId, int totalDocuments) { - List responses = new ArrayList(); - String baseDocumentJson = "{\"field\":"; - for (int i = 0; i < totalDocuments; i++) { - String json = baseDocumentJson + i + "}"; - String filename = "test_document_" + i; - responses.add(createTestDocument(json, filename, collectionId)); - } - return responses; - } - - private synchronized String setupTestDocuments() { - if (collectionId != null) { - return collectionId; - } - Collection collection = createTestCollection(); - String collectionId = collection.getCollectionId(); - @SuppressWarnings("unused") - List documentAccepted = createTestDocuments(collectionId, 10); - - WaitFor.Condition collectionAvailable = - new WaitForCollectionAvailable(environmentId, collectionId); - WaitFor.waitFor(collectionAvailable, 5, TimeUnit.SECONDS, 500); - - return collectionId; - } - - private TrainingQuery createTestQuery(String collectionId, String naturalLanguageQuery) { - AddTrainingDataOptions.Builder builder = - new AddTrainingDataOptions.Builder(environmentId, collectionId); - builder.naturalLanguageQuery(naturalLanguageQuery); - return discovery.addTrainingData(builder.build()).execute().getResult(); - } - - private List createTestQueries(String collectionId, int totalQueries) { - List responses = new ArrayList<>(); - for (int i = 0; i < totalQueries; i++) { - String naturalLanguageQuery = "Test query " + i; - responses.add(createTestQuery(collectionId, naturalLanguageQuery)); - } - return responses; - } - - private synchronized String setupTestQueries(String collectionId) { - ListTrainingDataOptions.Builder builder = - new ListTrainingDataOptions.Builder(environmentId, collectionId); - if (discovery.listTrainingData(builder.build()).execute().getResult().getQueries().size() > 0) { - return collectionId; - } - createTestQueries(collectionId, 10); - - WaitFor.Condition collectionAvailable = - new WaitForCollectionAvailable(environmentId, collectionId); - WaitFor.waitFor(collectionAvailable, 5, TimeUnit.SECONDS, 500); - - return collectionId; - } - - /** - * Gets the test configuration. - * - * @param jsonFile the json file - */ - public static Configuration getTestConfiguration(String jsonFile) { - try { - return GsonSingleton.getGson().fromJson(new FileReader(jsonFile), Configuration.class); - } catch (FileNotFoundException e) { - return null; - } - } - - private static class EnvironmentReady implements WaitFor.Condition { - private final Discovery discovery; - private final String environmentId; - - private EnvironmentReady(Discovery discovery, String environmentId) { - this.discovery = discovery; - this.environmentId = environmentId; - } - - @Override - public boolean isSatisfied() { - GetEnvironmentOptions getOptions = new GetEnvironmentOptions.Builder(environmentId).build(); - String status = discovery.getEnvironment(getOptions).execute().getResult().getStatus(); - return status.equals(Environment.Status.ACTIVE); - } - } - - private class WaitForDocumentAccepted implements WaitFor.Condition { - WaitForDocumentAccepted(String environmentId, String collectionId, String documentId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - this.documentId = documentId; - } - - @Override - public boolean isSatisfied() { - GetDocumentStatusOptions getOptions = - new GetDocumentStatusOptions.Builder(environmentId, collectionId, documentId).build(); - String status = discovery.getDocumentStatus(getOptions).execute().getResult().getStatus(); - return status.equals(DocumentStatus.Status.AVAILABLE); - } - - private final String environmentId; - private final String collectionId; - private final String documentId; - } - - private class WaitForCollectionAvailable implements WaitFor.Condition { - WaitForCollectionAvailable(String environmentId, String collectionId) { - this.environmentId = environmentId; - this.collectionId = collectionId; - } - - @Override - public boolean isSatisfied() { - GetCollectionOptions getOptions = - new GetCollectionOptions.Builder(environmentId, collectionId).build(); - Collection collectionResult = discovery.getCollection(getOptions).execute().getResult(); - String status = collectionResult.getStatus(); - return status.equals(Collection.Status.ACTIVE); - } - - private final String environmentId; - private final String collectionId; - } - - /** This only works on a Cloud Pak for Data instance, so ignoring to just run manually. */ - @Test - @Ignore - public void testQueryWithSpellingSuggestions() { - Authenticator authenticator = new BearerTokenAuthenticator(""); // fill in - Discovery service = new Discovery("2019-10-03", authenticator); - service.setServiceUrl(""); - - HttpConfigOptions configOptions = - new HttpConfigOptions.Builder().disableSslVerification(true).build(); - service.configureClient(configOptions); - - QueryOptions options = - new QueryOptions.Builder() - .naturalLanguageQuery("cluod") - .spellingSuggestions(true) - .environmentId("") // fill in - .collectionId("") // fill in - .build(); - QueryResponse response = service.query(options).execute().getResult(); - // System.out.println(response); - } - - /** This only works on a Cloud Pak for Data instance, so ignoring to just run manually. */ - @Test - @Ignore - public void testGetAutocompletion() { - Authenticator authenticator = new BearerTokenAuthenticator(""); // fill in - Discovery service = new Discovery("2019-10-03", authenticator); - service.setServiceUrl(""); - - HttpConfigOptions configOptions = - new HttpConfigOptions.Builder().disableSslVerification(true).build(); - service.configureClient(configOptions); - - GetAutocompletionOptions options = - new GetAutocompletionOptions.Builder() - .environmentId("") // fill in - .collectionId("") // fill in - .prefix("Ba") - .count(10L) - .build(); - Completions response = service.getAutocompletion(options).execute().getResult(); - // System.out.println(response); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryServiceTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryServiceTest.java deleted file mode 100644 index 381ce68bcf2..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryServiceTest.java +++ /dev/null @@ -1,2553 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.google.gson.JsonIOException; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.google.gson.JsonSyntaxException; -import com.ibm.cloud.sdk.core.http.HttpMediaType; -import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; -import com.ibm.cloud.sdk.core.util.GsonSingleton; -import com.ibm.watson.common.WatsonServiceUnitTest; -import com.ibm.watson.discovery.query.AggregationType; -import com.ibm.watson.discovery.query.Operator; -import com.ibm.watson.discovery.v1.model.AddDocumentOptions; -import com.ibm.watson.discovery.v1.model.AddTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.Collection; -import com.ibm.watson.discovery.v1.model.Configuration; -import com.ibm.watson.discovery.v1.model.Conversions; -import com.ibm.watson.discovery.v1.model.CreateCollectionOptions; -import com.ibm.watson.discovery.v1.model.CreateConfigurationOptions; -import com.ibm.watson.discovery.v1.model.CreateCredentialsOptions; -import com.ibm.watson.discovery.v1.model.CreateEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.CreateEventOptions; -import com.ibm.watson.discovery.v1.model.CreateEventResponse; -import com.ibm.watson.discovery.v1.model.CreateExpansionsOptions; -import com.ibm.watson.discovery.v1.model.CreateGatewayOptions; -import com.ibm.watson.discovery.v1.model.CreateStopwordListOptions; -import com.ibm.watson.discovery.v1.model.CreateTokenizationDictionaryOptions; -import com.ibm.watson.discovery.v1.model.CreateTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.CredentialDetails; -import com.ibm.watson.discovery.v1.model.Credentials; -import com.ibm.watson.discovery.v1.model.CredentialsList; -import com.ibm.watson.discovery.v1.model.DeleteAllTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.DeleteCollectionOptions; -import com.ibm.watson.discovery.v1.model.DeleteCollectionResponse; -import com.ibm.watson.discovery.v1.model.DeleteConfigurationOptions; -import com.ibm.watson.discovery.v1.model.DeleteConfigurationResponse; -import com.ibm.watson.discovery.v1.model.DeleteCredentials; -import com.ibm.watson.discovery.v1.model.DeleteCredentialsOptions; -import com.ibm.watson.discovery.v1.model.DeleteDocumentOptions; -import com.ibm.watson.discovery.v1.model.DeleteDocumentResponse; -import com.ibm.watson.discovery.v1.model.DeleteEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.DeleteEnvironmentResponse; -import com.ibm.watson.discovery.v1.model.DeleteExpansionsOptions; -import com.ibm.watson.discovery.v1.model.DeleteGatewayOptions; -import com.ibm.watson.discovery.v1.model.DeleteStopwordListOptions; -import com.ibm.watson.discovery.v1.model.DeleteTokenizationDictionaryOptions; -import com.ibm.watson.discovery.v1.model.DeleteTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.DeleteTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.DeleteUserDataOptions; -import com.ibm.watson.discovery.v1.model.DocumentAccepted; -import com.ibm.watson.discovery.v1.model.DocumentStatus; -import com.ibm.watson.discovery.v1.model.Enrichment; -import com.ibm.watson.discovery.v1.model.Environment; -import com.ibm.watson.discovery.v1.model.EventData; -import com.ibm.watson.discovery.v1.model.Expansion; -import com.ibm.watson.discovery.v1.model.Expansions; -import com.ibm.watson.discovery.v1.model.FederatedQueryNoticesOptions; -import com.ibm.watson.discovery.v1.model.FederatedQueryOptions; -import com.ibm.watson.discovery.v1.model.Gateway; -import com.ibm.watson.discovery.v1.model.GatewayDelete; -import com.ibm.watson.discovery.v1.model.GatewayList; -import com.ibm.watson.discovery.v1.model.GetCollectionOptions; -import com.ibm.watson.discovery.v1.model.GetConfigurationOptions; -import com.ibm.watson.discovery.v1.model.GetCredentialsOptions; -import com.ibm.watson.discovery.v1.model.GetDocumentStatusOptions; -import com.ibm.watson.discovery.v1.model.GetEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.GetGatewayOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsEventRateOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryEventOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryNoResultsOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryTokenEventOptions; -import com.ibm.watson.discovery.v1.model.GetStopwordListStatusOptions; -import com.ibm.watson.discovery.v1.model.GetTokenizationDictionaryStatusOptions; -import com.ibm.watson.discovery.v1.model.GetTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.GetTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionFieldsOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionFieldsResponse; -import com.ibm.watson.discovery.v1.model.ListCollectionsOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionsResponse; -import com.ibm.watson.discovery.v1.model.ListConfigurationsOptions; -import com.ibm.watson.discovery.v1.model.ListConfigurationsResponse; -import com.ibm.watson.discovery.v1.model.ListCredentialsOptions; -import com.ibm.watson.discovery.v1.model.ListEnvironmentsResponse; -import com.ibm.watson.discovery.v1.model.ListExpansionsOptions; -import com.ibm.watson.discovery.v1.model.ListFieldsOptions; -import com.ibm.watson.discovery.v1.model.ListGatewaysOptions; -import com.ibm.watson.discovery.v1.model.ListTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.ListTrainingExamplesOptions; -import com.ibm.watson.discovery.v1.model.LogQueryResponse; -import com.ibm.watson.discovery.v1.model.MetricResponse; -import com.ibm.watson.discovery.v1.model.MetricTokenResponse; -import com.ibm.watson.discovery.v1.model.NormalizationOperation; -import com.ibm.watson.discovery.v1.model.QueryLogOptions; -import com.ibm.watson.discovery.v1.model.QueryNoticesOptions; -import com.ibm.watson.discovery.v1.model.QueryNoticesResponse; -import com.ibm.watson.discovery.v1.model.QueryOptions; -import com.ibm.watson.discovery.v1.model.QueryResponse; -import com.ibm.watson.discovery.v1.model.Source; -import com.ibm.watson.discovery.v1.model.SourceOptions; -import com.ibm.watson.discovery.v1.model.SourceOptionsBuckets; -import com.ibm.watson.discovery.v1.model.SourceOptionsFolder; -import com.ibm.watson.discovery.v1.model.SourceOptionsObject; -import com.ibm.watson.discovery.v1.model.SourceOptionsSiteColl; -import com.ibm.watson.discovery.v1.model.SourceOptionsWebCrawl; -import com.ibm.watson.discovery.v1.model.TokenDictRule; -import com.ibm.watson.discovery.v1.model.TokenDictStatusResponse; -import com.ibm.watson.discovery.v1.model.TrainingDataSet; -import com.ibm.watson.discovery.v1.model.TrainingExample; -import com.ibm.watson.discovery.v1.model.TrainingExampleList; -import com.ibm.watson.discovery.v1.model.TrainingQuery; -import com.ibm.watson.discovery.v1.model.UpdateConfigurationOptions; -import com.ibm.watson.discovery.v1.model.UpdateCredentialsOptions; -import com.ibm.watson.discovery.v1.model.UpdateDocumentOptions; -import com.ibm.watson.discovery.v1.model.UpdateEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.UpdateTrainingExampleOptions; -import java.io.ByteArrayInputStream; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.RecordedRequest; -import org.junit.*; - -/** Unit tests for {@link Discovery}. */ -@Ignore -public class DiscoveryServiceTest extends WatsonServiceUnitTest { - private Discovery discoveryService; - - private static final String VERSION = "2019-04-30"; - - private static final String RESOURCE = "src/test/resources/discovery/v1/"; - private static final String DISCOVERY_TEST_CONFIG_FILE = RESOURCE + "test-config.json"; - private static final String ENV1_PATH = "/v1/environments/mock_envid?version=" + VERSION; - private static final String ENV2_PATH = "/v1/environments?version=" + VERSION; - private static final String CONF1_PATH = - "/v1/environments/mock_envid/configurations?version=" + VERSION; - private static final String CONF2_PATH = - "/v1/environments/mock_envid/configurations/mock_confid?version=" + VERSION; - private static final String COLL1_PATH = - "/v1/environments/mock_envid/collections?version=" + VERSION; - private static final String COLL2_PATH = - "/v1/environments/mock_envid/collections/mock_collid?version=" + VERSION; - private static final String COLL3_PATH = - "/v1/environments/mock_envid/collections/mock_collid/fields?version=" + VERSION; - private static final String DOCS1_PATH = - "/v1/environments/mock_envid/collections/mock_collid/documents?version=" + VERSION; - private static final String DOCS2_PATH = - "/v1/environments/mock_envid/collections/mock_collid/documents/mock_docid?version=" + VERSION; - private static final String Q1_PATH = - "/v1/environments/mock_envid/collections/mock_collid/query?version=" + VERSION; - private static final String Q2_PATH = "/v1/environments/mock_envid/query?version=" + VERSION; - private static final String Q3_PATH = - "/v1/environments/mock_envid/notices?version=" + VERSION + "&collection_ids=mock_collid"; - private static final String Q4_PATH = - "/v1/environments/mock_envid/collections/mock_collid/notices?version=" + VERSION; - private static final String TRAINING1_PATH = - "/v1/environments/mock_envid/collections/mock_collid/training_data?version=" + VERSION; - private static final String TRAINING2_PATH = - "/v1/environments/mock_envid/collections/mock_collid/training_data/mock_queryid/examples?version=" - + VERSION; - private static final String TRAINING3_PATH = - "/v1/environments/mock_envid/collections/mock_collid/training_data/mock_queryid?version=" - + VERSION; - private static final String TRAINING4_PATH = - "/v1/environments/mock_envid/collections/mock_collid/training_data/mock_queryid/examples/mock_docid?version=" - + VERSION; - private static final String FIELD_PATH = - "/v1/environments/mock_envid/fields?version=" + VERSION + "&collection_ids=mock_collid"; - private static final String EXPANSIONS_PATH = - "/v1/environments/mock_envid/collections/mock_collid/expansions?version=" + VERSION; - private static final String DELETE_USER_DATA_PATH = - "/v1/user_data?version=" + VERSION + "&customer_id=java_sdk_test_id"; - private static final String CREATE_CREDENTIALS_PATH = - "/v1/environments/mock_envid/credentials?version=" + VERSION; - private static final String DELETE_CREDENTIALS_PATH = - "/v1/environments/mock_envid/credentials/credential_id?version=" + VERSION; - private static final String GET_CREDENTIALS_PATH = - "/v1/environments/mock_envid/credentials/credential_id?version=" + VERSION; - private static final String LIST_CREDENTIALS_PATH = - "/v1/environments/mock_envid/credentials?version=" + VERSION; - private static final String UPDATE_CREDENTIALS_PATH = - "/v1/environments/mock_envid/credentials/new_credential_id?version=" + VERSION; - private static final String CREATE_EVENT_PATH = "/v1/events?version=" + VERSION; - private static final String GET_METRICS_EVENT_RATE_PATH = - "/v1/metrics/event_rate?version=" + VERSION; - private static final String GET_METRICS_QUERY_PATH = - "/v1/metrics/number_of_queries?version=" + VERSION; - private static final String GET_METRICS_QUERY_EVENT_PATH = - "/v1/metrics/number_of_queries_with_event?version=" + VERSION; - private static final String GET_METRICS_QUERY_NO_RESULTS_PATH = - "/v1/metrics/number_of_queries_with_no_search_results?version=" + VERSION; - private static final String GET_METRICS_QUERY_TOKEN_EVENT_PATH = - "/v1/metrics/top_query_tokens_with_event_rate?version=" + VERSION; - private static final String QUERY_LOG_PATH = "/v1/logs?version=" + VERSION; - - private String environmentId; - private String environmentName; - private String environmentDesc; - private String uniqueConfigName; - private String configurationId; - private String uniqueCollectionName; - private String collectionId; - private String documentId; - private String queryId; - private Date date; - private InputStream testStream; - - private Environment envResp; - private ListEnvironmentsResponse envsResp; - private Environment createEnvResp; - private DeleteEnvironmentResponse deleteEnvResp; - private Environment updateEnvResp; - private Configuration createConfResp; - private ListConfigurationsResponse getConfsResp; - private Configuration getConfResp; - private DeleteConfigurationResponse deleteConfResp; - private Configuration updateConfResp; - private Collection createCollResp; - private ListCollectionsResponse getCollsResp; - private Collection getCollResp; - private DeleteCollectionResponse deleteCollResp; - private ListCollectionFieldsResponse listfieldsCollResp; - private DocumentAccepted createDocResp; - private DocumentAccepted updateDocResp; - private DocumentStatus getDocResp; - private DeleteDocumentResponse deleteDocResp; - private QueryResponse queryResp; - private QueryNoticesResponse queryNoticesResp; - private TrainingQuery addTrainingQueryResp; - private TrainingDataSet listTrainingDataResp; - private TrainingExample createTrainingExampleResp; - private TrainingQuery getTrainingDataResp; - private TrainingExample getTrainingExampleResp; - private TrainingExample updateTrainingExampleResp; - private TrainingExampleList listTrainingExamplesResp; - private ListCollectionFieldsResponse listFieldsResp; - private Expansions expansionsResp; - private Credentials credentialsResp; - private CredentialsList listCredentialsResp; - private DeleteCredentials deleteCredentialsResp; - private CreateEventResponse createEventResp; - private MetricResponse metricResp; - private MetricTokenResponse metricTokenResp; - private LogQueryResponse logQueryResp; - private TokenDictStatusResponse tokenDictStatusResponse; - private TokenDictStatusResponse tokenDictStatusResponseStopwords; - private Gateway gatewayResponse; - private GatewayList listGatewaysResponse; - private GatewayDelete deleteGatewayResponse; - - /** Setup class. */ - @BeforeClass - public static void setupClass() {} - - /** - * Setup. - * - * @throws Exception the exception - */ - @Before - public void setup() throws Exception { - super.setUp(); - discoveryService = new Discovery(VERSION, new NoAuthAuthenticator()); - discoveryService.setServiceUrl(getMockWebServerUrl()); - - environmentId = "mock_envid"; - environmentName = "my_environment"; - environmentDesc = "My environment"; - uniqueConfigName = "my-config"; - configurationId = "mock_confid"; - uniqueCollectionName = "mock_collname"; - collectionId = "mock_collid"; - documentId = "mock_docid"; - queryId = "mock_queryid"; - date = new Date(); - testStream = new FileInputStream(RESOURCE + "get_env_resp.json"); - - envResp = loadFixture(RESOURCE + "get_env_resp.json", Environment.class); - envsResp = loadFixture(RESOURCE + "get_envs_resp.json", ListEnvironmentsResponse.class); - createEnvResp = loadFixture(RESOURCE + "create_env_resp.json", Environment.class); - deleteEnvResp = loadFixture(RESOURCE + "delete_env_resp.json", DeleteEnvironmentResponse.class); - updateEnvResp = loadFixture(RESOURCE + "update_env_resp.json", Environment.class); - createConfResp = loadFixture(RESOURCE + "create_conf_resp.json", Configuration.class); - getConfsResp = loadFixture(RESOURCE + "get_confs_resp.json", ListConfigurationsResponse.class); - getConfResp = loadFixture(RESOURCE + "get_conf_resp.json", Configuration.class); - deleteConfResp = - loadFixture(RESOURCE + "delete_conf_resp.json", DeleteConfigurationResponse.class); - updateConfResp = loadFixture(RESOURCE + "update_conf_resp.json", Configuration.class); - createCollResp = loadFixture(RESOURCE + "create_coll_resp.json", Collection.class); - getCollsResp = loadFixture(RESOURCE + "get_coll_resp.json", ListCollectionsResponse.class); - getCollResp = loadFixture(RESOURCE + "get_coll1_resp.json", Collection.class); - deleteCollResp = - loadFixture(RESOURCE + "delete_coll_resp.json", DeleteCollectionResponse.class); - listfieldsCollResp = - loadFixture(RESOURCE + "listfields_coll_resp.json", ListCollectionFieldsResponse.class); - createDocResp = loadFixture(RESOURCE + "create_doc_resp.json", DocumentAccepted.class); - updateDocResp = loadFixture(RESOURCE + "update_doc_resp.json", DocumentAccepted.class); - getDocResp = loadFixture(RESOURCE + "get_doc_resp.json", DocumentStatus.class); - deleteDocResp = loadFixture(RESOURCE + "delete_doc_resp.json", DeleteDocumentResponse.class); - queryResp = loadFixture(RESOURCE + "query1_resp.json", QueryResponse.class); - queryNoticesResp = loadFixture(RESOURCE + "query1_resp.json", QueryNoticesResponse.class); - addTrainingQueryResp = - loadFixture(RESOURCE + "add_training_query_resp.json", TrainingQuery.class); - listTrainingDataResp = - loadFixture(RESOURCE + "list_training_data_resp.json", TrainingDataSet.class); - createTrainingExampleResp = - loadFixture(RESOURCE + "add_training_example_resp.json", TrainingExample.class); - getTrainingDataResp = - loadFixture(RESOURCE + "get_training_data_resp.json", TrainingQuery.class); - getTrainingExampleResp = - loadFixture(RESOURCE + "get_training_example_resp.json", TrainingExample.class); - updateTrainingExampleResp = - loadFixture(RESOURCE + "update_training_example_resp.json", TrainingExample.class); - listTrainingExamplesResp = - loadFixture(RESOURCE + "list_training_examples_resp.json", TrainingExampleList.class); - listFieldsResp = - loadFixture(RESOURCE + "list_fields_resp.json", ListCollectionFieldsResponse.class); - expansionsResp = loadFixture(RESOURCE + "expansions_resp.json", Expansions.class); - credentialsResp = loadFixture(RESOURCE + "credentials_resp.json", Credentials.class); - listCredentialsResp = - loadFixture(RESOURCE + "list_credentials_resp.json", CredentialsList.class); - deleteCredentialsResp = - loadFixture(RESOURCE + "delete_credentials_resp.json", DeleteCredentials.class); - createEventResp = loadFixture(RESOURCE + "create_event_resp.json", CreateEventResponse.class); - metricResp = loadFixture(RESOURCE + "metric_resp.json", MetricResponse.class); - metricTokenResp = loadFixture(RESOURCE + "metric_token_resp.json", MetricTokenResponse.class); - logQueryResp = loadFixture(RESOURCE + "log_query_resp.json", LogQueryResponse.class); - tokenDictStatusResponse = - loadFixture(RESOURCE + "token_dict_status_resp.json", TokenDictStatusResponse.class); - tokenDictStatusResponseStopwords = - loadFixture( - RESOURCE + "token_dict_status_resp_stopwords.json", TokenDictStatusResponse.class); - gatewayResponse = loadFixture(RESOURCE + "gateway_resp.json", Gateway.class); - listGatewaysResponse = loadFixture(RESOURCE + "list_gateways_resp.json", GatewayList.class); - deleteGatewayResponse = loadFixture(RESOURCE + "delete_gateway_resp.json", GatewayDelete.class); - } - - /** Cleanup. */ - @After - public void cleanup() {} - - /** Negative - Test constructor with null version date. */ - @Test(expected = IllegalArgumentException.class) - public void testConstructorWithNullVersionDate() { - new Discovery(null, new NoAuthAuthenticator()); - } - - /** Negative - Test constructor with empty version date. */ - @Test(expected = IllegalArgumentException.class) - public void testConstructorWithEmptyVersionDate() { - new Discovery("", new NoAuthAuthenticator()); - } - - /** - * Gets the environment is successful. - * - * @throws InterruptedException the interrupted exception - */ - // Environment tests - @Test - public void getEnvironmentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(envResp)); - GetEnvironmentOptions getRequest = new GetEnvironmentOptions.Builder(environmentId).build(); - Environment response = discoveryService.getEnvironment(getRequest).execute().getResult(); - final RecordedRequest request = server.takeRequest(); - - assertEquals(ENV1_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(envResp, response); - } - - /** Gets the environment fails 1. */ - @Test(expected = IllegalArgumentException.class) - public void getEnvironmentFails1() { - GetEnvironmentOptions getRequest = new GetEnvironmentOptions.Builder().build(); - @SuppressWarnings("unused") - Environment response = discoveryService.getEnvironment(getRequest).execute().getResult(); - } - - /** Gets the environment fails 2. */ - @Test(expected = IllegalArgumentException.class) - public void getEnvironmentFails2() { - @SuppressWarnings("unused") - Environment response = discoveryService.getEnvironment(null).execute().getResult(); - } - - /** - * List environments is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listEnvironmentsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(envsResp)); - ListEnvironmentsResponse response = - discoveryService.listEnvironments(null).execute().getResult(); - final RecordedRequest request = server.takeRequest(); - - assertEquals(ENV2_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(envsResp, response); - } - - // Deleted test for listEnvironments with null name as this does not fail in the current SDK - - /** - * Creates the environment is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void createEnvironmentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createEnvResp)); - CreateEnvironmentOptions.Builder createRequestBuilder = - new CreateEnvironmentOptions.Builder() - .name(environmentName) - .size(CreateEnvironmentOptions.Size.XS); - createRequestBuilder.description(environmentDesc); - Environment response = - discoveryService.createEnvironment(createRequestBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(ENV2_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createEnvResp, response); - } - - // Deleted test for createEnvironment with null name as this does not fail in the current SDK - - /** - * Delete environment is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteEnvironmentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(deleteEnvResp)); - DeleteEnvironmentOptions deleteRequest = - new DeleteEnvironmentOptions.Builder(environmentId).build(); - DeleteEnvironmentResponse response = - discoveryService.deleteEnvironment(deleteRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(ENV1_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - assertEquals(deleteEnvResp.getEnvironmentId(), response.getEnvironmentId()); - assertEquals(deleteEnvResp.getStatus(), response.getStatus()); - } - - /** Delete environment fails. */ - @Test(expected = IllegalArgumentException.class) - public void deleteEnvironmentFails() { - discoveryService.deleteEnvironment(null).execute().getResult(); - } - - /** - * Update environment is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void updateEnvironmentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(updateEnvResp)); - UpdateEnvironmentOptions updateOptions = - new UpdateEnvironmentOptions.Builder(environmentId) - .name(environmentName) - .description(environmentDesc) - .size(UpdateEnvironmentOptions.Size.L) - .build(); - - assertEquals(environmentId, updateOptions.environmentId()); - assertEquals(environmentName, updateOptions.name()); - assertEquals(environmentDesc, updateOptions.description()); - assertEquals(UpdateEnvironmentOptions.Size.L, updateOptions.size()); - - Environment response = discoveryService.updateEnvironment(updateOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(ENV1_PATH, request.getPath()); - assertEquals(PUT, request.getMethod()); - assertEquals(updateEnvResp, response); - } - - /** Test source options. */ - @Test - public void testSourceOptions() { - String folderOwnerUserId = "folder_owner_user_id"; - String folderId = "folder_id"; - Long limit = 10L; - String objectName = "object_name"; - String siteCollectionPath = "site_collection_path"; - String url = "url"; - Long maximumHops = 5L; - Long requestTimeout = 2L; - String bucketName = "bucket_name"; - - SourceOptionsFolder folder = - new SourceOptionsFolder.Builder() - .ownerUserId(folderOwnerUserId) - .folderId(folderId) - .limit(limit) - .build(); - SourceOptionsObject object = - new SourceOptionsObject.Builder().name(objectName).limit(limit).build(); - SourceOptionsSiteColl siteColl = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath(siteCollectionPath) - .limit(limit) - .build(); - SourceOptionsWebCrawl webCrawl = - new SourceOptionsWebCrawl.Builder() - .url(url) - .limitToStartingHosts(true) - .crawlSpeed(SourceOptionsWebCrawl.CrawlSpeed.AGGRESSIVE) - .allowUntrustedCertificate(true) - .maximumHops(maximumHops) - .requestTimeout(requestTimeout) - .overrideRobotsTxt(true) - .build(); - SourceOptionsBuckets buckets = - new SourceOptionsBuckets.Builder().name(bucketName).limit(limit).build(); - SourceOptions sourceOptions = - new SourceOptions.Builder() - .folders(Collections.singletonList(folder)) - .objects(Collections.singletonList(object)) - .siteCollections(Collections.singletonList(siteColl)) - .urls(Collections.singletonList(webCrawl)) - .buckets(Collections.singletonList(buckets)) - .crawlAllBuckets(true) - .build(); - - assertEquals(folderOwnerUserId, sourceOptions.folders().get(0).ownerUserId()); - assertEquals(folderId, sourceOptions.folders().get(0).folderId()); - assertEquals(limit, sourceOptions.folders().get(0).limit()); - assertEquals(objectName, sourceOptions.objects().get(0).name()); - assertEquals(limit, sourceOptions.objects().get(0).limit()); - assertEquals(siteCollectionPath, sourceOptions.siteCollections().get(0).siteCollectionPath()); - assertEquals(limit, sourceOptions.siteCollections().get(0).limit()); - assertEquals(url, sourceOptions.urls().get(0).url()); - assertTrue(sourceOptions.urls().get(0).limitToStartingHosts()); - assertEquals( - SourceOptionsWebCrawl.CrawlSpeed.AGGRESSIVE, sourceOptions.urls().get(0).crawlSpeed()); - assertTrue(sourceOptions.urls().get(0).allowUntrustedCertificate()); - assertEquals(maximumHops, sourceOptions.urls().get(0).maximumHops()); - assertEquals(requestTimeout, sourceOptions.urls().get(0).requestTimeout()); - assertTrue(sourceOptions.urls().get(0).overrideRobotsTxt()); - assertEquals(bucketName, sourceOptions.buckets().get(0).name()); - assertEquals(limit, sourceOptions.buckets().get(0).limit()); - assertTrue(sourceOptions.crawlAllBuckets()); - } - - /** Test create configuration options. */ - // Configuration tests - @Test - public void testCreateConfigurationOptions() { - String name = "name"; - String description = "description"; - Conversions conversions = new Conversions.Builder().build(); - String firstEnrichmentName = "first"; - String secondEnrichmentName = "second"; - String sourceField = "source_field"; - String destinationField = "destination_field"; - List enrichments = new ArrayList<>(); - Enrichment firstEnrichment = - new Enrichment.Builder() - .enrichment(firstEnrichmentName) - .sourceField(sourceField) - .destinationField(destinationField) - .build(); - enrichments.add(firstEnrichment); - Enrichment secondEnrichment = - new Enrichment.Builder() - .enrichment(secondEnrichmentName) - .sourceField(sourceField) - .destinationField(destinationField) - .build(); - List normalizationOperations = new ArrayList<>(); - NormalizationOperation firstOp = - new NormalizationOperation.Builder() - .operation(NormalizationOperation.Operation.MERGE) - .build(); - NormalizationOperation secondOp = - new NormalizationOperation.Builder() - .operation(NormalizationOperation.Operation.COPY) - .build(); - normalizationOperations.add(firstOp); - Source source = new Source.Builder().build(); - - CreateConfigurationOptions createConfigurationOptions = - new CreateConfigurationOptions.Builder() - .environmentId(environmentId) - .name(name) - .description(description) - .conversions(conversions) - .enrichments(enrichments) - .addEnrichment(secondEnrichment) - .normalizations(normalizationOperations) - .addNormalization(secondOp) - .source(source) - .build(); - createConfigurationOptions = createConfigurationOptions.newBuilder().build(); - - enrichments.add(secondEnrichment); - normalizationOperations.add(secondOp); - - assertEquals(environmentId, createConfigurationOptions.environmentId()); - assertEquals(name, createConfigurationOptions.name()); - assertEquals(description, createConfigurationOptions.description()); - assertEquals(conversions, createConfigurationOptions.conversions()); - assertEquals(enrichments, createConfigurationOptions.enrichments()); - assertEquals(normalizationOperations, createConfigurationOptions.normalizations()); - assertEquals(source, createConfigurationOptions.source()); - } - - /** - * Creates the configuration is successful. - * - * @throws JsonSyntaxException the json syntax exception - * @throws JsonIOException the json IO exception - * @throws FileNotFoundException the file not found exception - * @throws InterruptedException the interrupted exception - */ - @Test - public void createConfigurationIsSuccessful() - throws JsonSyntaxException, JsonIOException, FileNotFoundException, InterruptedException { - server.enqueue(jsonResponse(createConfResp)); - CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(); - Configuration configuration = - GsonSingleton.getGson() - .fromJson(new FileReader(DISCOVERY_TEST_CONFIG_FILE), Configuration.class); - createBuilder.configuration(configuration); - createBuilder.environmentId(environmentId); - createBuilder.name(uniqueConfigName); - Configuration response = - discoveryService.createConfiguration(createBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CONF1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createConfResp, response); - } - - /** - * Gets the configuration is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getConfigurationIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getConfResp)); - - GetConfigurationOptions getRequest = - new GetConfigurationOptions.Builder(environmentId, configurationId).build(); - Configuration response = discoveryService.getConfiguration(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CONF2_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getConfResp, response); - } - - /** - * Gets the configurations is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getConfigurationsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getConfsResp)); - ListConfigurationsOptions getRequest = - new ListConfigurationsOptions.Builder(environmentId).build(); - ListConfigurationsResponse response = - discoveryService.listConfigurations(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CONF1_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getConfsResp, response); - } - - /** - * Delete configuration is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteConfigurationIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(deleteConfResp)); - DeleteConfigurationOptions deleteRequest = - new DeleteConfigurationOptions.Builder(environmentId, configurationId).build(); - DeleteConfigurationResponse response = - discoveryService.deleteConfiguration(deleteRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CONF2_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - assertEquals(deleteConfResp.getConfigurationId(), response.getConfigurationId()); - assertEquals(DeleteConfigurationResponse.Status.DELETED, response.getStatus()); - assertNotNull(response.getNotices()); - } - - /** - * Update configuration is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void updateConfigurationIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(updateConfResp)); - UpdateConfigurationOptions.Builder updateBuilder = new UpdateConfigurationOptions.Builder(); - updateBuilder.configurationId(configurationId); - updateBuilder.environmentId(environmentId); - Configuration newConf = new Configuration.Builder().name("newName").build(); - updateBuilder.configuration(newConf); - - Configuration response = - discoveryService.updateConfiguration(updateBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CONF2_PATH, request.getPath()); - assertEquals(PUT, request.getMethod()); - assertEquals(updateConfResp, response); - } - - /** - * Creates the collection is successful. - * - * @throws InterruptedException the interrupted exception - */ - // Collection tests - @Test - public void createCollectionIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createCollResp)); - CreateCollectionOptions.Builder createCollectionBuilder = - new CreateCollectionOptions.Builder(environmentId, uniqueCollectionName) - .configurationId(configurationId); - Collection response = - discoveryService.createCollection(createCollectionBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(COLL1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createCollResp, response); - } - - /** - * Gets the collections is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getCollectionsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getCollsResp)); - ListCollectionsOptions getRequest = new ListCollectionsOptions.Builder(environmentId).build(); - ListCollectionsResponse response = - discoveryService.listCollections(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(COLL1_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getCollsResp, response); - } - - /** - * Gets the collection is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getCollectionIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getCollResp)); - GetCollectionOptions getRequest = - new GetCollectionOptions.Builder(environmentId, collectionId).build(); - Collection response = discoveryService.getCollection(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(COLL2_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getCollResp, response); - } - - // no updateCollection yet? - - /** - * Listfields collection is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listfieldsCollectionIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(listfieldsCollResp)); - ListCollectionFieldsOptions getRequest = - new ListCollectionFieldsOptions.Builder(environmentId, collectionId).build(); - ListCollectionFieldsResponse response = - discoveryService.listCollectionFields(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(COLL3_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(listfieldsCollResp, response); - } - - /** - * Delete collection is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteCollectionIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(deleteCollResp)); - DeleteCollectionOptions deleteRequest = - new DeleteCollectionOptions.Builder(environmentId, collectionId).build(); - DeleteCollectionResponse response = - discoveryService.deleteCollection(deleteRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(COLL2_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - assertEquals(DeleteCollectionResponse.Status.DELETED, response.getStatus()); - assertEquals(deleteCollResp.getCollectionId(), response.getCollectionId()); - } - - /** - * Adds the document is successful. - * - * @throws InterruptedException the interrupted exception - */ - // Document tests - @Test - public void addDocumentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createDocResp)); - String myDocumentJson = "{\"field\":\"value\"}"; - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename("test_file"); - builder.metadata(myMetadata.toString()); - DocumentAccepted response = discoveryService.addDocument(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createDocResp, response); - } - - /** - * Adds the document from input stream is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void addDocumentFromInputStreamIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createDocResp)); - String myDocumentJson = "{\"field\":\"value\"}"; - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.file(documentStream); - builder.filename("test_file"); - builder.metadata(myMetadata.toString()); - DocumentAccepted response = discoveryService.addDocument(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createDocResp, response); - } - - /** - * Adds the document from input stream with media type is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void addDocumentFromInputStreamWithMediaTypeIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createDocResp)); - String myDocumentJson = "{\"field\":\"value\"}"; - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename("test_file"); - builder.metadata(myMetadata.toString()); - DocumentAccepted response = discoveryService.addDocument(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createDocResp, response); - } - - /** Adds the document without required parameters fails. */ - @Test(expected = IllegalArgumentException.class) - public void addDocumentWithoutRequiredParametersFails() { - AddDocumentOptions options = - new AddDocumentOptions.Builder(environmentId, collectionId).build(); - discoveryService.addDocument(options).execute().getResult(); - } - - /** - * Adds the document from input stream with file name and media type is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void addDocumentFromInputStreamWithFileNameAndMediaTypeIsSuccessful() - throws InterruptedException { - server.enqueue(jsonResponse(createDocResp)); - String myDocumentJson = "{\"field\":\"value\"}"; - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - - AddDocumentOptions.Builder builder = - new AddDocumentOptions.Builder(environmentId, collectionId); - builder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - builder.filename("test_file"); - builder.metadata(myMetadata.toString()); - DocumentAccepted response = discoveryService.addDocument(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createDocResp, response); - } - - // Deleted tests for (create)addDocument with file parameter as this is deprecated - - /** - * Update document is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void updateDocumentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(updateDocResp)); - UpdateDocumentOptions.Builder updateBuilder = - new UpdateDocumentOptions.Builder(environmentId, collectionId, documentId); - String myDocumentJson = "{\"field\":\"value2\"}"; - JsonObject myMetadata = new JsonObject(); - myMetadata.add("foo", new JsonPrimitive("bar")); - - InputStream documentStream = new ByteArrayInputStream(myDocumentJson.getBytes()); - updateBuilder.file(documentStream).fileContentType(HttpMediaType.APPLICATION_JSON); - updateBuilder.filename("test_file"); - updateBuilder.metadata(myMetadata.toString()); - DocumentAccepted response = - discoveryService.updateDocument(updateBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS2_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(updateDocResp, response); - } - - /** Update document without required parameters fails. */ - @Test(expected = IllegalArgumentException.class) - public void updateDocumentWithoutRequiredParametersFails() { - UpdateDocumentOptions options = - new UpdateDocumentOptions.Builder(environmentId, collectionId, documentId).build(); - discoveryService.updateDocument(options).execute().getResult(); - } - - /** - * Gets the document is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getDocumentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getDocResp)); - GetDocumentStatusOptions getRequest = - new GetDocumentStatusOptions.Builder(environmentId, collectionId, documentId).build(); - DocumentStatus response = discoveryService.getDocumentStatus(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS2_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getDocResp, response); - } - - /** - * Delete document is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteDocumentIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(deleteDocResp)); - DeleteDocumentOptions deleteRequest = - new DeleteDocumentOptions.Builder(environmentId, collectionId, documentId).build(); - DeleteDocumentResponse response = - discoveryService.deleteDocument(deleteRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DOCS2_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - assertEquals(deleteDocResp.getDocumentId(), response.getDocumentId()); - assertEquals(deleteDocResp.getStatus(), response.getStatus()); - } - - /** - * Query is successful. - * - * @throws InterruptedException the interrupted exception - */ - // Query tests - @Test - public void queryIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(queryResp)); - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - queryBuilder.count(5L); - queryBuilder.offset(5L); - String fieldNames = "field"; - queryBuilder.xReturn(fieldNames); - queryBuilder.query("field" + Operator.CONTAINS + 1); - queryBuilder.filter("field" + Operator.CONTAINS + 1); - queryBuilder.similar(true); - String similarDocumentIds = "doc1, doc2"; - queryBuilder.similarDocumentIds(similarDocumentIds); - String similarFields = "field1, field2"; - queryBuilder.similarFields(similarFields); - queryBuilder.xWatsonLoggingOptOut(true); - queryBuilder.bias("bias"); - QueryResponse response = discoveryService.query(queryBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(Q1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals( - GsonSingleton.getGson().toJsonTree(queryResp), - GsonSingleton.getGson().toJsonTree(response)); - } - - /** - * Query with aggregation term is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryWithAggregationTermIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(queryResp)); - QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId); - StringBuilder sb = new StringBuilder(); - sb.append(AggregationType.TERM); - sb.append(Operator.OPENING_GROUPING); - sb.append("field"); - sb.append(Operator.CLOSING_GROUPING); - String aggregation = sb.toString(); - queryBuilder.aggregation(aggregation); - QueryResponse response = discoveryService.query(queryBuilder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(Q1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals( - GsonSingleton.getGson().toJsonTree(queryResp), - GsonSingleton.getGson().toJsonTree(response)); - } - - /** - * Adds the training data is successful. - * - * @throws InterruptedException the interrupted exception - */ - // Training data tests - @Test - public void addTrainingDataIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(addTrainingQueryResp)); - AddTrainingDataOptions.Builder builder = - new AddTrainingDataOptions.Builder(environmentId, collectionId); - builder.naturalLanguageQuery("Example query"); - TrainingExample example = - new TrainingExample.Builder().documentId(documentId).relevance(0).build(); - builder.addExamples(example); - TrainingQuery response = - discoveryService.addTrainingData(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING1_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(addTrainingQueryResp, response); - } - - /** - * List training data is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listTrainingDataIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(listTrainingDataResp)); - ListTrainingDataOptions getRequest = - new ListTrainingDataOptions.Builder(environmentId, collectionId).build(); - TrainingDataSet response = discoveryService.listTrainingData(getRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING1_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(listTrainingDataResp, response); - } - - /** - * Delete all collection training data is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteAllCollectionTrainingDataIsSuccessful() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(204); - server.enqueue(desiredResponse); - DeleteAllTrainingDataOptions deleteRequest = - new DeleteAllTrainingDataOptions.Builder(environmentId, collectionId).build(); - discoveryService.deleteAllTrainingData(deleteRequest).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING1_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - } - - /** - * Creates the training example is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void createTrainingExampleIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createTrainingExampleResp)); - CreateTrainingExampleOptions.Builder builder = - new CreateTrainingExampleOptions.Builder(environmentId, collectionId, queryId); - builder.documentId(documentId); - builder.relevance(0); - TrainingExample response = - discoveryService.createTrainingExample(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING2_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(createTrainingExampleResp, response); - } - - /** - * Gets the training data is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getTrainingDataIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getTrainingDataResp)); - GetTrainingDataOptions.Builder builder = - new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId); - TrainingQuery response = - discoveryService.getTrainingData(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING3_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getTrainingDataResp, response); - } - - /** - * Gets the training example is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getTrainingExampleIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(getTrainingExampleResp)); - GetTrainingExampleOptions.Builder builder = - new GetTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId); - TrainingExample response = - discoveryService.getTrainingExample(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING4_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(getTrainingExampleResp, response); - } - - /** - * Delete training data is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteTrainingDataIsSuccessful() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(204); - server.enqueue(desiredResponse); - DeleteTrainingDataOptions.Builder builder = - new DeleteTrainingDataOptions.Builder(environmentId, collectionId, queryId); - discoveryService.deleteTrainingData(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING3_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - } - - /** - * Delete training example is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteTrainingExampleIsSuccessful() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(204); - server.enqueue(desiredResponse); - DeleteTrainingExampleOptions.Builder builder = - new DeleteTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId); - discoveryService.deleteTrainingExample(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING4_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - } - - /** - * Update training example is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void updateTrainingExampleIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(updateTrainingExampleResp)); - UpdateTrainingExampleOptions.Builder builder = - new UpdateTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId); - builder.relevance(100); - TrainingExample response = - discoveryService.updateTrainingExample(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING4_PATH, request.getPath()); - assertEquals(PUT, request.getMethod()); - assertEquals(updateTrainingExampleResp, response); - } - - /** - * List training examples is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listTrainingExamplesIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(listTrainingExamplesResp)); - ListTrainingExamplesOptions.Builder builder = - new ListTrainingExamplesOptions.Builder(environmentId, collectionId, queryId); - TrainingExampleList response = - discoveryService.listTrainingExamples(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(TRAINING2_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(listTrainingExamplesResp, response); - } - - /** - * List fields is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listFieldsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(listFieldsResp)); - ListFieldsOptions.Builder builder = - new ListFieldsOptions.Builder(environmentId, new ArrayList<>(Arrays.asList(collectionId))); - ListCollectionFieldsResponse response = - discoveryService.listFields(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(FIELD_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(listFieldsResp, response); - } - - /** - * Query notices is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryNoticesIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(queryNoticesResp)); - QueryNoticesOptions.Builder builder = - new QueryNoticesOptions.Builder(environmentId, collectionId); - discoveryService.queryNotices(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(Q4_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - } - - /** - * Federated query is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void federatedQueryIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(queryResp)); - FederatedQueryOptions.Builder builder = - new FederatedQueryOptions.Builder() - .environmentId(environmentId) - .collectionIds(collectionId) - .bias("bias") - .xWatsonLoggingOptOut(true); - discoveryService.federatedQuery(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(Q2_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - } - - /** - * Federated query notices is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void federatedQueryNoticesIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(queryNoticesResp)); - FederatedQueryNoticesOptions.Builder builder = - new FederatedQueryNoticesOptions.Builder( - environmentId, new ArrayList<>(Arrays.asList(collectionId))); - discoveryService.federatedQueryNotices(builder.build()).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(Q3_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - } - - /** - * Creates the expansions is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void createExpansionsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(expansionsResp)); - - List expansion1InputTerms = Arrays.asList("weekday", "week day"); - List expansion1ExpandedTerms = - Arrays.asList("monday", "tuesday", "wednesday", "thursday", "friday"); - List expansion2InputTerms = Arrays.asList("weekend", "week end"); - List expansion2ExpandedTerms = Arrays.asList("saturday", "sunday"); - Expansion expansion1 = - new Expansion.Builder() - .inputTerms(expansion1InputTerms) - .expandedTerms(expansion1ExpandedTerms) - .build(); - Expansion expansion2 = - new Expansion.Builder() - .inputTerms(expansion2InputTerms) - .expandedTerms(expansion2ExpandedTerms) - .build(); - Expansions expansions = - new Expansions.Builder().expansions(Arrays.asList(expansion1, expansion2)).build(); - - CreateExpansionsOptions createOptions = - new CreateExpansionsOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .expansions(expansions) - .build(); - Expansions createResults = - discoveryService.createExpansions(createOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(EXPANSIONS_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(expansion1, createResults.expansions().get(0)); - assertEquals(expansion2, createResults.expansions().get(1)); - } - - /** - * List expansions is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listExpansionsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(expansionsResp)); - - List expansion1InputTerms = Arrays.asList("weekday", "week day"); - List expansion1ExpandedTerms = - Arrays.asList("monday", "tuesday", "wednesday", "thursday", "friday"); - List expansion2InputTerms = Arrays.asList("weekend", "week end"); - List expansion2ExpandedTerms = Arrays.asList("saturday", "sunday"); - Expansion expansion1 = - new Expansion.Builder() - .inputTerms(expansion1InputTerms) - .expandedTerms(expansion1ExpandedTerms) - .build(); - Expansion expansion2 = - new Expansion.Builder() - .inputTerms(expansion2InputTerms) - .expandedTerms(expansion2ExpandedTerms) - .build(); - - ListExpansionsOptions listOptions = - new ListExpansionsOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - Expansions listResults = discoveryService.listExpansions(listOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(EXPANSIONS_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(expansion1, listResults.expansions().get(0)); - assertEquals(expansion2, listResults.expansions().get(1)); - } - - /** - * Delete expansions is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteExpansionsIsSuccessful() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(200); - server.enqueue(desiredResponse); - - DeleteExpansionsOptions deleteOptions = - new DeleteExpansionsOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - discoveryService.deleteExpansions(deleteOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(EXPANSIONS_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - } - - /** - * Delete user data is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteUserDataIsSuccessful() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(200); - server.enqueue(desiredResponse); - - String customerId = "java_sdk_test_id"; - - DeleteUserDataOptions deleteOptions = - new DeleteUserDataOptions.Builder().customerId(customerId).build(); - discoveryService.deleteUserData(deleteOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DELETE_USER_DATA_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - } - - /** Test credential details. */ - @Test - public void testCredentialDetails() { - String clientId = "client_id"; - String clientSecret = "client_secret"; // pragma: whitelist secret - String enterpriseId = "enterprise_id"; - String organizationUrl = "organization_url"; - String passphrase = "passphrase"; - String password = "password"; // pragma: whitelist secret - String privateKey = "private_key"; - String publicKeyId = "public_key_id"; - String siteCollectionPath = "site_collection_path"; - String url = "url"; - String username = "username"; - String gatewayId = "gateway_id"; - String sourceVersion = "source_version"; - String webApplicationUrl = "web_application_url"; - String domain = "domain"; - String endpoint = "endpoint"; - String accessKeyId = "access_key"; - String secretAccessKey = "secret_access_key"; - - CredentialDetails details = - new CredentialDetails.Builder() - .clientId(clientId) - .clientSecret(clientSecret) - .credentialType(CredentialDetails.CredentialType.USERNAME_PASSWORD) - .enterpriseId(enterpriseId) - .organizationUrl(organizationUrl) - .passphrase(passphrase) - .password(password) - .privateKey(privateKey) - .publicKeyId(publicKeyId) - .siteCollectionPath(siteCollectionPath) - .url(url) - .username(username) - .gatewayId(gatewayId) - .sourceVersion(sourceVersion) - .webApplicationUrl(webApplicationUrl) - .domain(domain) - .endpoint(endpoint) - .accessKeyId(accessKeyId) - .secretAccessKey(secretAccessKey) - .build(); - - assertEquals(clientId, details.clientId()); - assertEquals(clientSecret, details.clientSecret()); - assertEquals(CredentialDetails.CredentialType.USERNAME_PASSWORD, details.credentialType()); - assertEquals(enterpriseId, details.enterpriseId()); - assertEquals(organizationUrl, details.organizationUrl()); - assertEquals(passphrase, details.passphrase()); - assertEquals(password, details.password()); - assertEquals(privateKey, details.privateKey()); - assertEquals(publicKeyId, details.publicKeyId()); - assertEquals(siteCollectionPath, details.siteCollectionPath()); - assertEquals(url, details.url()); - assertEquals(username, details.username()); - assertEquals(gatewayId, details.gatewayId()); - assertEquals(sourceVersion, details.sourceVersion()); - assertEquals(webApplicationUrl, details.webApplicationUrl()); - assertEquals(domain, details.domain()); - assertEquals(accessKeyId, details.accessKeyId()); - assertEquals(secretAccessKey, details.secretAccessKey()); - } - - /** - * Creates the credentials is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void createCredentialsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(credentialsResp)); - - CredentialDetails details = - new CredentialDetails.Builder() - .credentialType(CredentialDetails.CredentialType.USERNAME_PASSWORD) - .url("url") - .username("username") - .build(); - Credentials credentials = - new Credentials.Builder() - .sourceType(Credentials.SourceType.SALESFORCE) - .credentialDetails(details) - .build(); - - CreateCredentialsOptions options = - new CreateCredentialsOptions.Builder() - .environmentId(environmentId) - .sourceType(Credentials.SourceType.SALESFORCE) - .credentials(credentials) - .credentialDetails(details) - .build(); - Credentials credentialsResponse = - discoveryService.createCredentials(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CREATE_CREDENTIALS_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(credentialsResp, credentialsResponse); - assertEquals(credentialsResp.credentialDetails(), credentialsResponse.credentialDetails()); - } - - /** - * Delete credentials is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void deleteCredentialsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(deleteCredentialsResp)); - - DeleteCredentialsOptions options = - new DeleteCredentialsOptions.Builder() - .environmentId(environmentId) - .credentialId("credential_id") - .build(); - DeleteCredentials response = discoveryService.deleteCredentials(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DELETE_CREDENTIALS_PATH, request.getPath()); - assertEquals(DELETE, request.getMethod()); - assertEquals(deleteCredentialsResp.getCredentialId(), response.getCredentialId()); - assertEquals(deleteCredentialsResp.getStatus(), response.getStatus()); - } - - /** - * Gets the credentials is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getCredentialsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(credentialsResp)); - - GetCredentialsOptions options = - new GetCredentialsOptions.Builder() - .environmentId(environmentId) - .credentialId("credential_id") - .build(); - Credentials credentialsResponse = - discoveryService.getCredentials(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET_CREDENTIALS_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(credentialsResp, credentialsResponse); - } - - /** - * List credentials is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void listCredentialsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(listCredentialsResp)); - - ListCredentialsOptions options = - new ListCredentialsOptions.Builder().environmentId(environmentId).build(); - CredentialsList response = discoveryService.listCredentials(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(LIST_CREDENTIALS_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(listCredentialsResp, response); - assertTrue(response.getCredentials().size() == 3); - } - - /** - * Update credentials is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void updateCredentialsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(credentialsResp)); - - CredentialDetails newDetails = - new CredentialDetails.Builder() - .clientId("new_client_id") - .clientSecret("new_client_secret") - .credentialType(CredentialDetails.CredentialType.USERNAME_PASSWORD) - .enterpriseId("new_enterprise_id") - .organizationUrl("new_organization_url") - .passphrase("new_passphrase") - .password("new_password") - .privateKey("new_private_key") - .publicKeyId("new_public_key_id") - .siteCollectionPath("new_site_collection_path") - .url("new_url") - .username("new_username") - .build(); - Credentials newCredentials = - new Credentials.Builder() - .sourceType(Credentials.SourceType.SALESFORCE) - .credentialDetails(newDetails) - .build(); - - UpdateCredentialsOptions options = - new UpdateCredentialsOptions.Builder() - .environmentId(environmentId) - .credentialId("new_credential_id") - .sourceType(Credentials.SourceType.SALESFORCE) - .credentials(newCredentials) - .credentialDetails(newDetails) - .build(); - Credentials response = discoveryService.updateCredentials(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(UPDATE_CREDENTIALS_PATH, request.getPath()); - assertEquals(PUT, request.getMethod()); - assertEquals(credentialsResp, response); - } - - /** - * Creates the event is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void createEventIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(createEventResp)); - - Long displayRank = 1L; - String sessionToken = "mock_session_token"; - - EventData eventData = - new EventData.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .documentId(documentId) - .displayRank(displayRank) - .sessionToken(sessionToken) - .clientTimestamp(date) - .build(); - CreateEventOptions createEventOptions = - new CreateEventOptions.Builder() - .type(CreateEventOptions.Type.CLICK) - .data(eventData) - .build(); - - CreateEventResponse response = - discoveryService.createEvent(createEventOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(CREATE_EVENT_PATH, request.getPath()); - assertEquals(POST, request.getMethod()); - assertEquals(CreateEventOptions.Type.CLICK, response.getType()); - assertEquals(environmentId, response.getData().environmentId()); - assertEquals(collectionId, response.getData().collectionId()); - assertEquals(documentId, response.getData().documentId()); - assertNotNull(response.getData().clientTimestamp()); - assertEquals(displayRank, response.getData().displayRank()); - assertEquals(queryId, response.getData().queryId()); - assertEquals(sessionToken, response.getData().sessionToken()); - } - - /** - * Gets the metrics event rate is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsEventRateIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - GetMetricsEventRateOptions options = - new GetMetricsEventRateOptions.Builder() - .startTime(date) - .endTime(date) - .resultType(GetMetricsEventRateOptions.ResultType.DOCUMENT) - .build(); - - MetricResponse response = discoveryService.getMetricsEventRate(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics event rate no args is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsEventRateNoArgsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - MetricResponse response = discoveryService.getMetricsEventRate().execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET_METRICS_EVENT_RATE_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - GetMetricsQueryOptions options = - new GetMetricsQueryOptions.Builder() - .startTime(date) - .endTime(date) - .resultType(GetMetricsQueryOptions.ResultType.DOCUMENT) - .build(); - - MetricResponse response = discoveryService.getMetricsQuery(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query no args is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryNoArgsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - MetricResponse response = discoveryService.getMetricsQuery().execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET_METRICS_QUERY_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query event is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryEventIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - GetMetricsQueryEventOptions options = - new GetMetricsQueryEventOptions.Builder() - .startTime(date) - .endTime(date) - .resultType(GetMetricsQueryEventOptions.ResultType.DOCUMENT) - .build(); - - MetricResponse response = discoveryService.getMetricsQueryEvent(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query event no args is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryEventNoArgsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - MetricResponse response = discoveryService.getMetricsQueryEvent().execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET_METRICS_QUERY_EVENT_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query no results is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryNoResultsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - GetMetricsQueryNoResultsOptions options = - new GetMetricsQueryNoResultsOptions.Builder() - .startTime(date) - .endTime(date) - .resultType(GetMetricsQueryEventOptions.ResultType.DOCUMENT) - .build(); - - MetricResponse response = - discoveryService.getMetricsQueryNoResults(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query no results no args is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryNoResultsNoArgsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricResp)); - - String interval = "1d"; - Long key = 1533513600000L; - Double eventRate = 0.0; - - MetricResponse response = discoveryService.getMetricsQueryNoResults().execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET_METRICS_QUERY_NO_RESULTS_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(interval, response.getAggregations().get(0).getInterval()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertNotNull(response.getAggregations().get(0).getResults().get(0).getKeyAsString()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query token event is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryTokenEventIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricTokenResp)); - - Long count = 10L; - String key = "beat"; - Long matchingResults = 117L; - Double eventRate = 0.0; - - GetMetricsQueryTokenEventOptions options = - new GetMetricsQueryTokenEventOptions.Builder().count(count).build(); - - MetricTokenResponse response = - discoveryService.getMetricsQueryTokenEvent(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertEquals( - matchingResults, - response.getAggregations().get(0).getResults().get(0).getMatchingResults()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Gets the metrics query token event no args is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void getMetricsQueryTokenEventNoArgsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(metricTokenResp)); - - String key = "beat"; - Long matchingResults = 117L; - Double eventRate = 0.0; - - MetricTokenResponse response = - discoveryService.getMetricsQueryTokenEvent().execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET_METRICS_QUERY_TOKEN_EVENT_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertTrue(!response.getAggregations().isEmpty()); - assertEquals(CreateEventOptions.Type.CLICK, response.getAggregations().get(0).getEventType()); - assertTrue(!response.getAggregations().get(0).getResults().isEmpty()); - assertEquals(key, response.getAggregations().get(0).getResults().get(0).getKey()); - assertEquals( - matchingResults, - response.getAggregations().get(0).getResults().get(0).getMatchingResults()); - assertEquals(eventRate, response.getAggregations().get(0).getResults().get(0).getEventRate()); - } - - /** - * Query log is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryLogIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(logQueryResp)); - - List sortList = new ArrayList<>(); - sortList.add("field_a"); - String extraSort = "field_b"; - String filter = "filter"; - String naturalLanguageQuery = "Who beat Ken Jennings in Jeopardy!"; - Long count = 5L; - Long offset = 5L; - Long matchingResults = 2L; - String customerId = ""; - String sessionToken = "mock_session_token"; - String eventType = "query"; - Long resultCount = 0L; - - QueryLogOptions options = - new QueryLogOptions.Builder() - .sort(sortList) - .addSort(extraSort) - .count(count) - .filter(filter) - .offset(offset) - .query(naturalLanguageQuery) - .build(); - - LogQueryResponse response = discoveryService.queryLog(options).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertEquals(matchingResults, response.getMatchingResults()); - assertTrue(!response.getResults().isEmpty()); - assertEquals(environmentId, response.getResults().get(0).getEnvironmentId()); - assertEquals(customerId, response.getResults().get(0).getCustomerId()); - assertNotNull(response.getResults().get(0).getCreatedTimestamp()); - assertEquals(queryId, response.getResults().get(0).getQueryId()); - assertEquals(sessionToken, response.getResults().get(0).getSessionToken()); - assertEquals(eventType, response.getResults().get(0).getEventType()); - assertNotNull(response.getResults().get(0).getDocumentResults().getResults()); - assertEquals(resultCount, response.getResults().get(0).getDocumentResults().getCount()); - } - - /** - * Query log no args is successful. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void queryLogNoArgsIsSuccessful() throws InterruptedException { - server.enqueue(jsonResponse(logQueryResp)); - - List sortList = new ArrayList<>(); - sortList.add("field_a"); - Long matchingResults = 2L; - String customerId = ""; - String sessionToken = "mock_session_token"; - String eventType = "query"; - Long resultCount = 0L; - - LogQueryResponse response = discoveryService.queryLog().execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(QUERY_LOG_PATH, request.getPath()); - assertEquals(GET, request.getMethod()); - assertEquals(matchingResults, response.getMatchingResults()); - assertTrue(!response.getResults().isEmpty()); - assertEquals(environmentId, response.getResults().get(0).getEnvironmentId()); - assertEquals(customerId, response.getResults().get(0).getCustomerId()); - assertNotNull(response.getResults().get(0).getCreatedTimestamp()); - assertEquals(queryId, response.getResults().get(0).getQueryId()); - assertEquals(sessionToken, response.getResults().get(0).getSessionToken()); - assertEquals(eventType, response.getResults().get(0).getEventType()); - assertNotNull(response.getResults().get(0).getDocumentResults().getResults()); - assertEquals(resultCount, response.getResults().get(0).getDocumentResults().getCount()); - } - - /** Test token dict rule. */ - @Test - public void testTokenDictRule() { - String text = "text"; - String partOfSpeech = "noun"; - List readings = Arrays.asList("reading 1", "reading 2"); - List tokens = Arrays.asList("token 1", "token 2"); - - TokenDictRule tokenDictRule = - new TokenDictRule.Builder() - .text(text) - .partOfSpeech(partOfSpeech) - .readings(readings) - .tokens(tokens) - .build(); - - assertEquals(text, tokenDictRule.text()); - assertEquals(partOfSpeech, tokenDictRule.partOfSpeech()); - assertEquals(readings, tokenDictRule.readings()); - assertEquals(tokens, tokenDictRule.tokens()); - } - - /** Test create tokenization dictionary options. */ - @Test - public void testCreateTokenizationDictionaryOptions() { - String text = "text"; - String partOfSpeech = "noun"; - List tokens = Arrays.asList("token 1", "token 2"); - - TokenDictRule firstTokenDictRule = - new TokenDictRule.Builder().text(text).partOfSpeech(partOfSpeech).tokens(tokens).build(); - TokenDictRule secondTokenDictRule = - new TokenDictRule.Builder().text(text).partOfSpeech(partOfSpeech).tokens(tokens).build(); - List tokenDictRuleList = new ArrayList<>(); - tokenDictRuleList.add(firstTokenDictRule); - - CreateTokenizationDictionaryOptions createOptions = - new CreateTokenizationDictionaryOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .tokenizationRules(tokenDictRuleList) - .addTokenizationRules(secondTokenDictRule) - .build(); - - tokenDictRuleList.add(secondTokenDictRule); - - assertEquals(environmentId, createOptions.environmentId()); - assertEquals(collectionId, createOptions.collectionId()); - assertEquals(tokenDictRuleList, createOptions.tokenizationRules()); - } - - /** Test get tokenization dictionary status options. */ - @Test - public void testGetTokenizationDictionaryStatusOptions() { - GetTokenizationDictionaryStatusOptions getOptions = - new GetTokenizationDictionaryStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - - assertEquals(environmentId, getOptions.environmentId()); - assertEquals(collectionId, getOptions.collectionId()); - } - - /** Test delete tokenization dictionary options. */ - @Test - public void testDeleteTokenizationDictionaryOptions() { - DeleteTokenizationDictionaryOptions deleteOptions = - new DeleteTokenizationDictionaryOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - - assertEquals(environmentId, deleteOptions.environmentId()); - assertEquals(collectionId, deleteOptions.collectionId()); - } - - /** - * Test create tokenization dictionary. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testCreateTokenizationDictionary() throws InterruptedException { - server.enqueue(jsonResponse(tokenDictStatusResponse)); - - String text = "text"; - String partOfSpeech = "noun"; - List tokens = Arrays.asList("token 1", "token 2"); - TokenDictRule tokenDictRule = - new TokenDictRule.Builder().text(text).tokens(tokens).partOfSpeech(partOfSpeech).build(); - CreateTokenizationDictionaryOptions createOptions = - new CreateTokenizationDictionaryOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .tokenizationRules(Collections.singletonList(tokenDictRule)) - .build(); - TokenDictStatusResponse response = - discoveryService.createTokenizationDictionary(createOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(POST, request.getMethod()); - assertEquals(tokenDictStatusResponse, response); - } - - /** - * Test get tokenization dictionary status. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testGetTokenizationDictionaryStatus() throws InterruptedException { - server.enqueue(jsonResponse(tokenDictStatusResponse)); - - GetTokenizationDictionaryStatusOptions getOptions = - new GetTokenizationDictionaryStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - TokenDictStatusResponse response = - discoveryService.getTokenizationDictionaryStatus(getOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertEquals(tokenDictStatusResponse, response); - } - - /** - * Test delete tokenization dictionary. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testDeleteTokenizationDictionary() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(200); - server.enqueue(desiredResponse); - - DeleteTokenizationDictionaryOptions deleteOptions = - new DeleteTokenizationDictionaryOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - discoveryService.deleteTokenizationDictionary(deleteOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DELETE, request.getMethod()); - } - - /** Test create stopword list options. */ - @Test - public void testCreateStopwordListOptions() { - String testFilename = "test_filename"; - - CreateStopwordListOptions createStopwordListOptions = - new CreateStopwordListOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .stopwordFile(testStream) - .stopwordFilename(testFilename) - .build(); - - assertEquals(environmentId, createStopwordListOptions.environmentId()); - assertEquals(collectionId, createStopwordListOptions.collectionId()); - assertEquals(testStream, createStopwordListOptions.stopwordFile()); - assertEquals(testFilename, createStopwordListOptions.stopwordFilename()); - } - - /** - * Test create stopword list. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testCreateStopwordList() throws InterruptedException { - server.enqueue(jsonResponse(tokenDictStatusResponse)); - - String testFilename = "test_filename"; - - CreateStopwordListOptions createStopwordListOptions = - new CreateStopwordListOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .stopwordFile(testStream) - .stopwordFilename(testFilename) - .build(); - TokenDictStatusResponse response = - discoveryService.createStopwordList(createStopwordListOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(POST, request.getMethod()); - assertEquals(tokenDictStatusResponse, response); - } - - /** Test delete stopword list options. */ - @Test - public void testDeleteStopwordListOptions() { - DeleteStopwordListOptions deleteStopwordListOptions = - new DeleteStopwordListOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - - assertEquals(environmentId, deleteStopwordListOptions.environmentId()); - assertEquals(collectionId, deleteStopwordListOptions.collectionId()); - } - - /** - * Test delete stopword list. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testDeleteStopwordList() throws InterruptedException { - MockResponse desiredResponse = new MockResponse().setResponseCode(200); - server.enqueue(desiredResponse); - - DeleteStopwordListOptions deleteStopwordListOptions = - new DeleteStopwordListOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - discoveryService.deleteStopwordList(deleteStopwordListOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DELETE, request.getMethod()); - } - - /** Test get stopword list status options. */ - @Test - public void testGetStopwordListStatusOptions() { - GetStopwordListStatusOptions getStopwordListStatusOptions = - new GetStopwordListStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - - assertEquals(environmentId, getStopwordListStatusOptions.environmentId()); - assertEquals(collectionId, getStopwordListStatusOptions.collectionId()); - } - - /** - * Test get stopword list status. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testGetStopwordListStatus() throws InterruptedException { - server.enqueue(jsonResponse(tokenDictStatusResponseStopwords)); - - String type = "stopwords"; - - GetStopwordListStatusOptions getStopwordListStatusOptions = - new GetStopwordListStatusOptions.Builder() - .environmentId(environmentId) - .collectionId(collectionId) - .build(); - TokenDictStatusResponse response = - discoveryService.getStopwordListStatus(getStopwordListStatusOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertEquals(TokenDictStatusResponse.Status.ACTIVE, response.getStatus()); - assertEquals(type, response.getType()); - } - - /** Test create gateway options. */ - @Test - public void testCreateGatewayOptions() { - String name = "name"; - - CreateGatewayOptions createGatewayOptions = - new CreateGatewayOptions.Builder().environmentId(environmentId).name(name).build(); - - assertEquals(environmentId, createGatewayOptions.environmentId()); - assertEquals(name, createGatewayOptions.name()); - } - - /** - * Test create gateway. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testCreateGateway() throws InterruptedException { - server.enqueue(jsonResponse(gatewayResponse)); - - String name = "name"; - - CreateGatewayOptions createGatewayOptions = - new CreateGatewayOptions.Builder().environmentId(environmentId).name(name).build(); - Gateway response = discoveryService.createGateway(createGatewayOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(POST, request.getMethod()); - assertEquals(gatewayResponse, response); - } - - /** Test delete gateway options. */ - @Test - public void testDeleteGatewayOptions() { - String gatewayId = "gateway_id"; - - DeleteGatewayOptions deleteGatewayOptions = - new DeleteGatewayOptions.Builder() - .environmentId(environmentId) - .gatewayId(gatewayId) - .build(); - - assertEquals(environmentId, deleteGatewayOptions.environmentId()); - assertEquals(gatewayId, deleteGatewayOptions.gatewayId()); - } - - /** - * Test delete gateway. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testDeleteGateway() throws InterruptedException { - server.enqueue(jsonResponse(deleteGatewayResponse)); - - String gatewayId = "gateway_id"; - - DeleteGatewayOptions deleteGatewayOptions = - new DeleteGatewayOptions.Builder() - .environmentId(environmentId) - .gatewayId(gatewayId) - .build(); - GatewayDelete response = - discoveryService.deleteGateway(deleteGatewayOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(DELETE, request.getMethod()); - assertEquals(deleteGatewayResponse.getGatewayId(), response.getGatewayId()); - assertEquals(deleteGatewayResponse.getStatus(), response.getStatus()); - } - - /** Test get gateway options. */ - @Test - public void testGetGatewayOptions() { - String gatewayId = "gateway_id"; - - GetGatewayOptions getGatewayOptions = - new GetGatewayOptions.Builder().environmentId(environmentId).gatewayId(gatewayId).build(); - - assertEquals(environmentId, getGatewayOptions.environmentId()); - assertEquals(gatewayId, getGatewayOptions.gatewayId()); - } - - /** - * Test get gateway. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testGetGateway() throws InterruptedException { - server.enqueue(jsonResponse(gatewayResponse)); - - String gatewayId = "gateway_id"; - - GetGatewayOptions getGatewayOptions = - new GetGatewayOptions.Builder().environmentId(environmentId).gatewayId(gatewayId).build(); - Gateway response = discoveryService.getGateway(getGatewayOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertEquals(gatewayResponse, response); - } - - /** Test list gateways options. */ - @Test - public void testListGatewaysOptions() { - ListGatewaysOptions listGatewaysOptions = - new ListGatewaysOptions.Builder().environmentId(environmentId).build(); - - assertEquals(environmentId, listGatewaysOptions.environmentId()); - } - - /** - * Test list gateways. - * - * @throws InterruptedException the interrupted exception - */ - @Test - public void testListGateways() throws InterruptedException { - server.enqueue(jsonResponse(listGatewaysResponse)); - - ListGatewaysOptions listGatewaysOptions = - new ListGatewaysOptions.Builder().environmentId(environmentId).build(); - GatewayList response = discoveryService.listGateways(listGatewaysOptions).execute().getResult(); - RecordedRequest request = server.takeRequest(); - - assertEquals(GET, request.getMethod()); - assertEquals(listGatewaysResponse, response); - } - - /** Test source options web crawl. */ - @Test - public void testSourceOptionsWebCrawl() { - String url = "url"; - String crawlSpeed = "crawl_speed"; - Long maximumHops = 1L; - Long requestTimeout = 2000L; - - SourceOptionsWebCrawl sourceOptionsWebCrawl = - new SourceOptionsWebCrawl.Builder() - .url(url) - .limitToStartingHosts(true) - .crawlSpeed(crawlSpeed) - .allowUntrustedCertificate(true) - .maximumHops(maximumHops) - .requestTimeout(requestTimeout) - .overrideRobotsTxt(true) - .build(); - - assertEquals(url, sourceOptionsWebCrawl.url()); - assertTrue(sourceOptionsWebCrawl.limitToStartingHosts()); - assertEquals(crawlSpeed, sourceOptionsWebCrawl.crawlSpeed()); - assertTrue(sourceOptionsWebCrawl.allowUntrustedCertificate()); - assertEquals(maximumHops, sourceOptionsWebCrawl.maximumHops()); - assertEquals(requestTimeout, sourceOptionsWebCrawl.requestTimeout()); - assertTrue(sourceOptionsWebCrawl.overrideRobotsTxt()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryTest.java deleted file mode 100644 index 9bea27d47de..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/DiscoveryTest.java +++ /dev/null @@ -1,4391 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.http.Response; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.cloud.sdk.core.util.RequestUtils; -import com.ibm.watson.discovery.v1.model.AddDocumentOptions; -import com.ibm.watson.discovery.v1.model.AddTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.Collection; -import com.ibm.watson.discovery.v1.model.Completions; -import com.ibm.watson.discovery.v1.model.Configuration; -import com.ibm.watson.discovery.v1.model.Conversions; -import com.ibm.watson.discovery.v1.model.CreateCollectionOptions; -import com.ibm.watson.discovery.v1.model.CreateConfigurationOptions; -import com.ibm.watson.discovery.v1.model.CreateCredentialsOptions; -import com.ibm.watson.discovery.v1.model.CreateEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.CreateEventOptions; -import com.ibm.watson.discovery.v1.model.CreateEventResponse; -import com.ibm.watson.discovery.v1.model.CreateExpansionsOptions; -import com.ibm.watson.discovery.v1.model.CreateGatewayOptions; -import com.ibm.watson.discovery.v1.model.CreateStopwordListOptions; -import com.ibm.watson.discovery.v1.model.CreateTokenizationDictionaryOptions; -import com.ibm.watson.discovery.v1.model.CreateTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.CredentialDetails; -import com.ibm.watson.discovery.v1.model.Credentials; -import com.ibm.watson.discovery.v1.model.CredentialsList; -import com.ibm.watson.discovery.v1.model.DeleteAllTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.DeleteCollectionOptions; -import com.ibm.watson.discovery.v1.model.DeleteCollectionResponse; -import com.ibm.watson.discovery.v1.model.DeleteConfigurationOptions; -import com.ibm.watson.discovery.v1.model.DeleteConfigurationResponse; -import com.ibm.watson.discovery.v1.model.DeleteCredentials; -import com.ibm.watson.discovery.v1.model.DeleteCredentialsOptions; -import com.ibm.watson.discovery.v1.model.DeleteDocumentOptions; -import com.ibm.watson.discovery.v1.model.DeleteDocumentResponse; -import com.ibm.watson.discovery.v1.model.DeleteEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.DeleteEnvironmentResponse; -import com.ibm.watson.discovery.v1.model.DeleteExpansionsOptions; -import com.ibm.watson.discovery.v1.model.DeleteGatewayOptions; -import com.ibm.watson.discovery.v1.model.DeleteStopwordListOptions; -import com.ibm.watson.discovery.v1.model.DeleteTokenizationDictionaryOptions; -import com.ibm.watson.discovery.v1.model.DeleteTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.DeleteTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.DeleteUserDataOptions; -import com.ibm.watson.discovery.v1.model.DocumentAccepted; -import com.ibm.watson.discovery.v1.model.DocumentStatus; -import com.ibm.watson.discovery.v1.model.Enrichment; -import com.ibm.watson.discovery.v1.model.EnrichmentOptions; -import com.ibm.watson.discovery.v1.model.Environment; -import com.ibm.watson.discovery.v1.model.EventData; -import com.ibm.watson.discovery.v1.model.Expansion; -import com.ibm.watson.discovery.v1.model.Expansions; -import com.ibm.watson.discovery.v1.model.FederatedQueryNoticesOptions; -import com.ibm.watson.discovery.v1.model.FederatedQueryOptions; -import com.ibm.watson.discovery.v1.model.FontSetting; -import com.ibm.watson.discovery.v1.model.Gateway; -import com.ibm.watson.discovery.v1.model.GatewayDelete; -import com.ibm.watson.discovery.v1.model.GatewayList; -import com.ibm.watson.discovery.v1.model.GetAutocompletionOptions; -import com.ibm.watson.discovery.v1.model.GetCollectionOptions; -import com.ibm.watson.discovery.v1.model.GetConfigurationOptions; -import com.ibm.watson.discovery.v1.model.GetCredentialsOptions; -import com.ibm.watson.discovery.v1.model.GetDocumentStatusOptions; -import com.ibm.watson.discovery.v1.model.GetEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.GetGatewayOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsEventRateOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryEventOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryNoResultsOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryOptions; -import com.ibm.watson.discovery.v1.model.GetMetricsQueryTokenEventOptions; -import com.ibm.watson.discovery.v1.model.GetStopwordListStatusOptions; -import com.ibm.watson.discovery.v1.model.GetTokenizationDictionaryStatusOptions; -import com.ibm.watson.discovery.v1.model.GetTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.GetTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.HtmlSettings; -import com.ibm.watson.discovery.v1.model.ListCollectionFieldsOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionFieldsResponse; -import com.ibm.watson.discovery.v1.model.ListCollectionsOptions; -import com.ibm.watson.discovery.v1.model.ListCollectionsResponse; -import com.ibm.watson.discovery.v1.model.ListConfigurationsOptions; -import com.ibm.watson.discovery.v1.model.ListConfigurationsResponse; -import com.ibm.watson.discovery.v1.model.ListCredentialsOptions; -import com.ibm.watson.discovery.v1.model.ListEnvironmentsOptions; -import com.ibm.watson.discovery.v1.model.ListEnvironmentsResponse; -import com.ibm.watson.discovery.v1.model.ListExpansionsOptions; -import com.ibm.watson.discovery.v1.model.ListFieldsOptions; -import com.ibm.watson.discovery.v1.model.ListGatewaysOptions; -import com.ibm.watson.discovery.v1.model.ListTrainingDataOptions; -import com.ibm.watson.discovery.v1.model.ListTrainingExamplesOptions; -import com.ibm.watson.discovery.v1.model.LogQueryResponse; -import com.ibm.watson.discovery.v1.model.MetricResponse; -import com.ibm.watson.discovery.v1.model.MetricTokenResponse; -import com.ibm.watson.discovery.v1.model.NluEnrichmentConcepts; -import com.ibm.watson.discovery.v1.model.NluEnrichmentEmotion; -import com.ibm.watson.discovery.v1.model.NluEnrichmentEntities; -import com.ibm.watson.discovery.v1.model.NluEnrichmentFeatures; -import com.ibm.watson.discovery.v1.model.NluEnrichmentKeywords; -import com.ibm.watson.discovery.v1.model.NluEnrichmentRelations; -import com.ibm.watson.discovery.v1.model.NluEnrichmentSemanticRoles; -import com.ibm.watson.discovery.v1.model.NluEnrichmentSentiment; -import com.ibm.watson.discovery.v1.model.NormalizationOperation; -import com.ibm.watson.discovery.v1.model.PdfHeadingDetection; -import com.ibm.watson.discovery.v1.model.PdfSettings; -import com.ibm.watson.discovery.v1.model.QueryLogOptions; -import com.ibm.watson.discovery.v1.model.QueryNoticesOptions; -import com.ibm.watson.discovery.v1.model.QueryNoticesResponse; -import com.ibm.watson.discovery.v1.model.QueryOptions; -import com.ibm.watson.discovery.v1.model.QueryResponse; -import com.ibm.watson.discovery.v1.model.SegmentSettings; -import com.ibm.watson.discovery.v1.model.Source; -import com.ibm.watson.discovery.v1.model.SourceOptions; -import com.ibm.watson.discovery.v1.model.SourceOptionsBuckets; -import com.ibm.watson.discovery.v1.model.SourceOptionsFolder; -import com.ibm.watson.discovery.v1.model.SourceOptionsObject; -import com.ibm.watson.discovery.v1.model.SourceOptionsSiteColl; -import com.ibm.watson.discovery.v1.model.SourceOptionsWebCrawl; -import com.ibm.watson.discovery.v1.model.SourceSchedule; -import com.ibm.watson.discovery.v1.model.StatusDetails; -import com.ibm.watson.discovery.v1.model.TokenDictRule; -import com.ibm.watson.discovery.v1.model.TokenDictStatusResponse; -import com.ibm.watson.discovery.v1.model.TrainingDataSet; -import com.ibm.watson.discovery.v1.model.TrainingExample; -import com.ibm.watson.discovery.v1.model.TrainingExampleList; -import com.ibm.watson.discovery.v1.model.TrainingQuery; -import com.ibm.watson.discovery.v1.model.UpdateCollectionOptions; -import com.ibm.watson.discovery.v1.model.UpdateConfigurationOptions; -import com.ibm.watson.discovery.v1.model.UpdateCredentialsOptions; -import com.ibm.watson.discovery.v1.model.UpdateDocumentOptions; -import com.ibm.watson.discovery.v1.model.UpdateEnvironmentOptions; -import com.ibm.watson.discovery.v1.model.UpdateTrainingExampleOptions; -import com.ibm.watson.discovery.v1.model.WordHeadingDetection; -import com.ibm.watson.discovery.v1.model.WordSettings; -import com.ibm.watson.discovery.v1.model.WordStyle; -import com.ibm.watson.discovery.v1.model.XPathPatterns; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -/** Unit test class for the Discovery service. */ -public class DiscoveryTest { - - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - protected MockWebServer server; - protected Discovery discoveryService; - - // Construct the service with a null authenticator (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testConstructorWithNullAuthenticator() throws Throwable { - final String serviceName = "testService"; - // Set mock values for global params - String version = "testString"; - new Discovery(version, serviceName, null); - } - - // Test the getter for the version global parameter - @Test - public void testGetVersion() throws Throwable { - assertEquals(discoveryService.getVersion(), "testString"); - } - - // Test the createEnvironment operation with a valid options model parameter - @Test - public void testCreateEnvironmentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"environment_id\": \"environmentId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"read_only\": true, \"size\": \"LT\", \"requested_size\": \"requestedSize\", \"index_capacity\": {\"documents\": {\"available\": 9, \"maximum_allowed\": 14}, \"disk_usage\": {\"used_bytes\": 9, \"maximum_allowed_bytes\": 19}, \"collections\": {\"available\": 9, \"maximum_allowed\": 14}}, \"search_status\": {\"scope\": \"scope\", \"status\": \"NO_DATA\", \"status_description\": \"statusDescription\", \"last_trained\": \"2019-01-01\"}}"; - String createEnvironmentPath = "/v1/environments"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the CreateEnvironmentOptions model - CreateEnvironmentOptions createEnvironmentOptionsModel = - new CreateEnvironmentOptions.Builder() - .name("testString") - .description("testString") - .size("LT") - .build(); - - // Invoke createEnvironment() with a valid options model and verify the result - Response response = - discoveryService.createEnvironment(createEnvironmentOptionsModel).execute(); - assertNotNull(response); - Environment responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createEnvironmentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createEnvironment operation with and without retries enabled - @Test - public void testCreateEnvironmentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateEnvironmentWOptions(); - - discoveryService.disableRetries(); - testCreateEnvironmentWOptions(); - } - - // Test the createEnvironment operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateEnvironmentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createEnvironment(null).execute(); - } - - // Test the listEnvironments operation with a valid options model parameter - @Test - public void testListEnvironmentsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"environments\": [{\"environment_id\": \"environmentId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"read_only\": true, \"size\": \"LT\", \"requested_size\": \"requestedSize\", \"index_capacity\": {\"documents\": {\"available\": 9, \"maximum_allowed\": 14}, \"disk_usage\": {\"used_bytes\": 9, \"maximum_allowed_bytes\": 19}, \"collections\": {\"available\": 9, \"maximum_allowed\": 14}}, \"search_status\": {\"scope\": \"scope\", \"status\": \"NO_DATA\", \"status_description\": \"statusDescription\", \"last_trained\": \"2019-01-01\"}}]}"; - String listEnvironmentsPath = "/v1/environments"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListEnvironmentsOptions model - ListEnvironmentsOptions listEnvironmentsOptionsModel = - new ListEnvironmentsOptions.Builder().name("testString").build(); - - // Invoke listEnvironments() with a valid options model and verify the result - Response response = - discoveryService.listEnvironments(listEnvironmentsOptionsModel).execute(); - assertNotNull(response); - ListEnvironmentsResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listEnvironmentsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("name"), "testString"); - } - - // Test the listEnvironments operation with and without retries enabled - @Test - public void testListEnvironmentsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListEnvironmentsWOptions(); - - discoveryService.disableRetries(); - testListEnvironmentsWOptions(); - } - - // Test the getEnvironment operation with a valid options model parameter - @Test - public void testGetEnvironmentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"environment_id\": \"environmentId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"read_only\": true, \"size\": \"LT\", \"requested_size\": \"requestedSize\", \"index_capacity\": {\"documents\": {\"available\": 9, \"maximum_allowed\": 14}, \"disk_usage\": {\"used_bytes\": 9, \"maximum_allowed_bytes\": 19}, \"collections\": {\"available\": 9, \"maximum_allowed\": 14}}, \"search_status\": {\"scope\": \"scope\", \"status\": \"NO_DATA\", \"status_description\": \"statusDescription\", \"last_trained\": \"2019-01-01\"}}"; - String getEnvironmentPath = "/v1/environments/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetEnvironmentOptions model - GetEnvironmentOptions getEnvironmentOptionsModel = - new GetEnvironmentOptions.Builder().environmentId("testString").build(); - - // Invoke getEnvironment() with a valid options model and verify the result - Response response = - discoveryService.getEnvironment(getEnvironmentOptionsModel).execute(); - assertNotNull(response); - Environment responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getEnvironmentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getEnvironment operation with and without retries enabled - @Test - public void testGetEnvironmentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetEnvironmentWOptions(); - - discoveryService.disableRetries(); - testGetEnvironmentWOptions(); - } - - // Test the getEnvironment operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetEnvironmentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getEnvironment(null).execute(); - } - - // Test the updateEnvironment operation with a valid options model parameter - @Test - public void testUpdateEnvironmentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"environment_id\": \"environmentId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"read_only\": true, \"size\": \"LT\", \"requested_size\": \"requestedSize\", \"index_capacity\": {\"documents\": {\"available\": 9, \"maximum_allowed\": 14}, \"disk_usage\": {\"used_bytes\": 9, \"maximum_allowed_bytes\": 19}, \"collections\": {\"available\": 9, \"maximum_allowed\": 14}}, \"search_status\": {\"scope\": \"scope\", \"status\": \"NO_DATA\", \"status_description\": \"statusDescription\", \"last_trained\": \"2019-01-01\"}}"; - String updateEnvironmentPath = "/v1/environments/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the UpdateEnvironmentOptions model - UpdateEnvironmentOptions updateEnvironmentOptionsModel = - new UpdateEnvironmentOptions.Builder() - .environmentId("testString") - .name("testString") - .description("testString") - .size("S") - .build(); - - // Invoke updateEnvironment() with a valid options model and verify the result - Response response = - discoveryService.updateEnvironment(updateEnvironmentOptionsModel).execute(); - assertNotNull(response); - Environment responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateEnvironmentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the updateEnvironment operation with and without retries enabled - @Test - public void testUpdateEnvironmentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testUpdateEnvironmentWOptions(); - - discoveryService.disableRetries(); - testUpdateEnvironmentWOptions(); - } - - // Test the updateEnvironment operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateEnvironmentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.updateEnvironment(null).execute(); - } - - // Test the deleteEnvironment operation with a valid options model parameter - @Test - public void testDeleteEnvironmentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"environment_id\": \"environmentId\", \"status\": \"deleted\"}"; - String deleteEnvironmentPath = "/v1/environments/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteEnvironmentOptions model - DeleteEnvironmentOptions deleteEnvironmentOptionsModel = - new DeleteEnvironmentOptions.Builder().environmentId("testString").build(); - - // Invoke deleteEnvironment() with a valid options model and verify the result - Response response = - discoveryService.deleteEnvironment(deleteEnvironmentOptionsModel).execute(); - assertNotNull(response); - DeleteEnvironmentResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteEnvironmentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteEnvironment operation with and without retries enabled - @Test - public void testDeleteEnvironmentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteEnvironmentWOptions(); - - discoveryService.disableRetries(); - testDeleteEnvironmentWOptions(); - } - - // Test the deleteEnvironment operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteEnvironmentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteEnvironment(null).execute(); - } - - // Test the listFields operation with a valid options model parameter - @Test - public void testListFieldsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"fields\": [{\"field\": \"field\", \"type\": \"nested\"}]}"; - String listFieldsPath = "/v1/environments/testString/fields"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListFieldsOptions model - ListFieldsOptions listFieldsOptionsModel = - new ListFieldsOptions.Builder() - .environmentId("testString") - .collectionIds(java.util.Arrays.asList("testString")) - .build(); - - // Invoke listFields() with a valid options model and verify the result - Response response = - discoveryService.listFields(listFieldsOptionsModel).execute(); - assertNotNull(response); - ListCollectionFieldsResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listFieldsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals( - query.get("collection_ids"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - } - - // Test the listFields operation with and without retries enabled - @Test - public void testListFieldsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListFieldsWOptions(); - - discoveryService.disableRetries(); - testListFieldsWOptions(); - } - - // Test the listFields operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListFieldsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listFields(null).execute(); - } - - // Test the createConfiguration operation with a valid options model parameter - @Test - public void testCreateConfigurationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"configuration_id\": \"configurationId\", \"name\": \"name\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"description\": \"description\", \"conversions\": {\"pdf\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}]}}, \"word\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}], \"styles\": [{\"level\": 5, \"names\": [\"names\"]}]}}, \"html\": {\"exclude_tags_completely\": [\"excludeTagsCompletely\"], \"exclude_tags_keep_content\": [\"excludeTagsKeepContent\"], \"keep_content\": {\"xpaths\": [\"xpaths\"]}, \"exclude_content\": {\"xpaths\": [\"xpaths\"]}, \"keep_tag_attributes\": [\"keepTagAttributes\"], \"exclude_tag_attributes\": [\"excludeTagAttributes\"]}, \"segment\": {\"enabled\": false, \"selector_tags\": [\"selectorTags\"], \"annotated_fields\": [\"annotatedFields\"]}, \"json_normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"image_text_recognition\": true}, \"enrichments\": [{\"description\": \"description\", \"destination_field\": \"destinationField\", \"source_field\": \"sourceField\", \"overwrite\": false, \"enrichment\": \"enrichment\", \"ignore_downstream_errors\": false, \"options\": {\"features\": {\"keywords\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5}, \"entities\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5, \"mentions\": true, \"mention_types\": true, \"sentence_locations\": false, \"model\": \"model\"}, \"sentiment\": {\"document\": true, \"targets\": [\"target\"]}, \"emotion\": {\"document\": true, \"targets\": [\"target\"]}, \"categories\": {\"anyKey\": \"anyValue\"}, \"semantic_roles\": {\"entities\": true, \"keywords\": true, \"limit\": 5}, \"relations\": {\"model\": \"model\"}, \"concepts\": {\"limit\": 5}}, \"language\": \"ar\", \"model\": \"model\"}}], \"normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"source\": {\"type\": \"box\", \"credential_id\": \"credentialId\", \"schedule\": {\"enabled\": true, \"time_zone\": \"America/New_York\", \"frequency\": \"daily\"}, \"options\": {\"folders\": [{\"owner_user_id\": \"ownerUserId\", \"folder_id\": \"folderId\", \"limit\": 5}], \"objects\": [{\"name\": \"name\", \"limit\": 5}], \"site_collections\": [{\"site_collection_path\": \"siteCollectionPath\", \"limit\": 5}], \"urls\": [{\"url\": \"url\", \"limit_to_starting_hosts\": true, \"crawl_speed\": \"normal\", \"allow_untrusted_certificate\": false, \"maximum_hops\": 2, \"request_timeout\": 30000, \"override_robots_txt\": false, \"blacklist\": [\"blacklist\"]}], \"buckets\": [{\"name\": \"name\", \"limit\": 5}], \"crawl_all_buckets\": false}}}"; - String createConfigurationPath = "/v1/environments/testString/configurations"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the FontSetting model - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - - // Construct an instance of the PdfHeadingDetection model - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - - // Construct an instance of the PdfSettings model - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - - // Construct an instance of the WordStyle model - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the WordHeadingDetection model - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - - // Construct an instance of the WordSettings model - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - - // Construct an instance of the XPathPatterns model - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - - // Construct an instance of the HtmlSettings model - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("testString")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the SegmentSettings model - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(false) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the NormalizationOperation model - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("copy") - .sourceField("testString") - .destinationField("testString") - .build(); - - // Construct an instance of the Conversions model - Conversions conversionsModel = - new Conversions.Builder() - .pdf(pdfSettingsModel) - .word(wordSettingsModel) - .html(htmlSettingsModel) - .segment(segmentSettingsModel) - .jsonNormalizations(java.util.Arrays.asList(normalizationOperationModel)) - .imageTextRecognition(true) - .build(); - - // Construct an instance of the NluEnrichmentKeywords model - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the NluEnrichmentEntities model - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - - // Construct an instance of the NluEnrichmentSentiment model - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the NluEnrichmentEmotion model - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the NluEnrichmentSemanticRoles model - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the NluEnrichmentRelations model - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - - // Construct an instance of the NluEnrichmentConcepts model - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - - // Construct an instance of the NluEnrichmentFeatures model - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - - // Construct an instance of the EnrichmentOptions model - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - - // Construct an instance of the Enrichment model - Enrichment enrichmentModel = - new Enrichment.Builder() - .description("testString") - .destinationField("testString") - .sourceField("testString") - .overwrite(false) - .enrichment("testString") - .ignoreDownstreamErrors(false) - .options(enrichmentOptionsModel) - .build(); - - // Construct an instance of the SourceSchedule model - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("daily") - .build(); - - // Construct an instance of the SourceOptionsFolder model - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the SourceOptionsObject model - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - - // Construct an instance of the SourceOptionsSiteColl model - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the SourceOptionsWebCrawl model - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the SourceOptionsBuckets model - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - - // Construct an instance of the SourceOptions model - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - - // Construct an instance of the Source model - Source sourceModel = - new Source.Builder() - .type("box") - .credentialId("testString") - .schedule(sourceScheduleModel) - .options(sourceOptionsModel) - .build(); - - // Construct an instance of the CreateConfigurationOptions model - CreateConfigurationOptions createConfigurationOptionsModel = - new CreateConfigurationOptions.Builder() - .environmentId("testString") - .name("testString") - .description("testString") - .conversions(conversionsModel) - .enrichments(java.util.Arrays.asList(enrichmentModel)) - .normalizations(java.util.Arrays.asList(normalizationOperationModel)) - .source(sourceModel) - .build(); - - // Invoke createConfiguration() with a valid options model and verify the result - Response response = - discoveryService.createConfiguration(createConfigurationOptionsModel).execute(); - assertNotNull(response); - Configuration responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createConfigurationPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createConfiguration operation with and without retries enabled - @Test - public void testCreateConfigurationWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateConfigurationWOptions(); - - discoveryService.disableRetries(); - testCreateConfigurationWOptions(); - } - - // Test the createConfiguration operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateConfigurationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createConfiguration(null).execute(); - } - - // Test the listConfigurations operation with a valid options model parameter - @Test - public void testListConfigurationsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"configurations\": [{\"configuration_id\": \"configurationId\", \"name\": \"name\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"description\": \"description\", \"conversions\": {\"pdf\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}]}}, \"word\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}], \"styles\": [{\"level\": 5, \"names\": [\"names\"]}]}}, \"html\": {\"exclude_tags_completely\": [\"excludeTagsCompletely\"], \"exclude_tags_keep_content\": [\"excludeTagsKeepContent\"], \"keep_content\": {\"xpaths\": [\"xpaths\"]}, \"exclude_content\": {\"xpaths\": [\"xpaths\"]}, \"keep_tag_attributes\": [\"keepTagAttributes\"], \"exclude_tag_attributes\": [\"excludeTagAttributes\"]}, \"segment\": {\"enabled\": false, \"selector_tags\": [\"selectorTags\"], \"annotated_fields\": [\"annotatedFields\"]}, \"json_normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"image_text_recognition\": true}, \"enrichments\": [{\"description\": \"description\", \"destination_field\": \"destinationField\", \"source_field\": \"sourceField\", \"overwrite\": false, \"enrichment\": \"enrichment\", \"ignore_downstream_errors\": false, \"options\": {\"features\": {\"keywords\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5}, \"entities\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5, \"mentions\": true, \"mention_types\": true, \"sentence_locations\": false, \"model\": \"model\"}, \"sentiment\": {\"document\": true, \"targets\": [\"target\"]}, \"emotion\": {\"document\": true, \"targets\": [\"target\"]}, \"categories\": {\"anyKey\": \"anyValue\"}, \"semantic_roles\": {\"entities\": true, \"keywords\": true, \"limit\": 5}, \"relations\": {\"model\": \"model\"}, \"concepts\": {\"limit\": 5}}, \"language\": \"ar\", \"model\": \"model\"}}], \"normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"source\": {\"type\": \"box\", \"credential_id\": \"credentialId\", \"schedule\": {\"enabled\": true, \"time_zone\": \"America/New_York\", \"frequency\": \"daily\"}, \"options\": {\"folders\": [{\"owner_user_id\": \"ownerUserId\", \"folder_id\": \"folderId\", \"limit\": 5}], \"objects\": [{\"name\": \"name\", \"limit\": 5}], \"site_collections\": [{\"site_collection_path\": \"siteCollectionPath\", \"limit\": 5}], \"urls\": [{\"url\": \"url\", \"limit_to_starting_hosts\": true, \"crawl_speed\": \"normal\", \"allow_untrusted_certificate\": false, \"maximum_hops\": 2, \"request_timeout\": 30000, \"override_robots_txt\": false, \"blacklist\": [\"blacklist\"]}], \"buckets\": [{\"name\": \"name\", \"limit\": 5}], \"crawl_all_buckets\": false}}}]}"; - String listConfigurationsPath = "/v1/environments/testString/configurations"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListConfigurationsOptions model - ListConfigurationsOptions listConfigurationsOptionsModel = - new ListConfigurationsOptions.Builder() - .environmentId("testString") - .name("testString") - .build(); - - // Invoke listConfigurations() with a valid options model and verify the result - Response response = - discoveryService.listConfigurations(listConfigurationsOptionsModel).execute(); - assertNotNull(response); - ListConfigurationsResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listConfigurationsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("name"), "testString"); - } - - // Test the listConfigurations operation with and without retries enabled - @Test - public void testListConfigurationsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListConfigurationsWOptions(); - - discoveryService.disableRetries(); - testListConfigurationsWOptions(); - } - - // Test the listConfigurations operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListConfigurationsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listConfigurations(null).execute(); - } - - // Test the getConfiguration operation with a valid options model parameter - @Test - public void testGetConfigurationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"configuration_id\": \"configurationId\", \"name\": \"name\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"description\": \"description\", \"conversions\": {\"pdf\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}]}}, \"word\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}], \"styles\": [{\"level\": 5, \"names\": [\"names\"]}]}}, \"html\": {\"exclude_tags_completely\": [\"excludeTagsCompletely\"], \"exclude_tags_keep_content\": [\"excludeTagsKeepContent\"], \"keep_content\": {\"xpaths\": [\"xpaths\"]}, \"exclude_content\": {\"xpaths\": [\"xpaths\"]}, \"keep_tag_attributes\": [\"keepTagAttributes\"], \"exclude_tag_attributes\": [\"excludeTagAttributes\"]}, \"segment\": {\"enabled\": false, \"selector_tags\": [\"selectorTags\"], \"annotated_fields\": [\"annotatedFields\"]}, \"json_normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"image_text_recognition\": true}, \"enrichments\": [{\"description\": \"description\", \"destination_field\": \"destinationField\", \"source_field\": \"sourceField\", \"overwrite\": false, \"enrichment\": \"enrichment\", \"ignore_downstream_errors\": false, \"options\": {\"features\": {\"keywords\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5}, \"entities\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5, \"mentions\": true, \"mention_types\": true, \"sentence_locations\": false, \"model\": \"model\"}, \"sentiment\": {\"document\": true, \"targets\": [\"target\"]}, \"emotion\": {\"document\": true, \"targets\": [\"target\"]}, \"categories\": {\"anyKey\": \"anyValue\"}, \"semantic_roles\": {\"entities\": true, \"keywords\": true, \"limit\": 5}, \"relations\": {\"model\": \"model\"}, \"concepts\": {\"limit\": 5}}, \"language\": \"ar\", \"model\": \"model\"}}], \"normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"source\": {\"type\": \"box\", \"credential_id\": \"credentialId\", \"schedule\": {\"enabled\": true, \"time_zone\": \"America/New_York\", \"frequency\": \"daily\"}, \"options\": {\"folders\": [{\"owner_user_id\": \"ownerUserId\", \"folder_id\": \"folderId\", \"limit\": 5}], \"objects\": [{\"name\": \"name\", \"limit\": 5}], \"site_collections\": [{\"site_collection_path\": \"siteCollectionPath\", \"limit\": 5}], \"urls\": [{\"url\": \"url\", \"limit_to_starting_hosts\": true, \"crawl_speed\": \"normal\", \"allow_untrusted_certificate\": false, \"maximum_hops\": 2, \"request_timeout\": 30000, \"override_robots_txt\": false, \"blacklist\": [\"blacklist\"]}], \"buckets\": [{\"name\": \"name\", \"limit\": 5}], \"crawl_all_buckets\": false}}}"; - String getConfigurationPath = "/v1/environments/testString/configurations/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetConfigurationOptions model - GetConfigurationOptions getConfigurationOptionsModel = - new GetConfigurationOptions.Builder() - .environmentId("testString") - .configurationId("testString") - .build(); - - // Invoke getConfiguration() with a valid options model and verify the result - Response response = - discoveryService.getConfiguration(getConfigurationOptionsModel).execute(); - assertNotNull(response); - Configuration responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getConfigurationPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getConfiguration operation with and without retries enabled - @Test - public void testGetConfigurationWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetConfigurationWOptions(); - - discoveryService.disableRetries(); - testGetConfigurationWOptions(); - } - - // Test the getConfiguration operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetConfigurationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getConfiguration(null).execute(); - } - - // Test the updateConfiguration operation with a valid options model parameter - @Test - public void testUpdateConfigurationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"configuration_id\": \"configurationId\", \"name\": \"name\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"description\": \"description\", \"conversions\": {\"pdf\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}]}}, \"word\": {\"heading\": {\"fonts\": [{\"level\": 5, \"min_size\": 7, \"max_size\": 7, \"bold\": true, \"italic\": true, \"name\": \"name\"}], \"styles\": [{\"level\": 5, \"names\": [\"names\"]}]}}, \"html\": {\"exclude_tags_completely\": [\"excludeTagsCompletely\"], \"exclude_tags_keep_content\": [\"excludeTagsKeepContent\"], \"keep_content\": {\"xpaths\": [\"xpaths\"]}, \"exclude_content\": {\"xpaths\": [\"xpaths\"]}, \"keep_tag_attributes\": [\"keepTagAttributes\"], \"exclude_tag_attributes\": [\"excludeTagAttributes\"]}, \"segment\": {\"enabled\": false, \"selector_tags\": [\"selectorTags\"], \"annotated_fields\": [\"annotatedFields\"]}, \"json_normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"image_text_recognition\": true}, \"enrichments\": [{\"description\": \"description\", \"destination_field\": \"destinationField\", \"source_field\": \"sourceField\", \"overwrite\": false, \"enrichment\": \"enrichment\", \"ignore_downstream_errors\": false, \"options\": {\"features\": {\"keywords\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5}, \"entities\": {\"sentiment\": false, \"emotion\": false, \"limit\": 5, \"mentions\": true, \"mention_types\": true, \"sentence_locations\": false, \"model\": \"model\"}, \"sentiment\": {\"document\": true, \"targets\": [\"target\"]}, \"emotion\": {\"document\": true, \"targets\": [\"target\"]}, \"categories\": {\"anyKey\": \"anyValue\"}, \"semantic_roles\": {\"entities\": true, \"keywords\": true, \"limit\": 5}, \"relations\": {\"model\": \"model\"}, \"concepts\": {\"limit\": 5}}, \"language\": \"ar\", \"model\": \"model\"}}], \"normalizations\": [{\"operation\": \"copy\", \"source_field\": \"sourceField\", \"destination_field\": \"destinationField\"}], \"source\": {\"type\": \"box\", \"credential_id\": \"credentialId\", \"schedule\": {\"enabled\": true, \"time_zone\": \"America/New_York\", \"frequency\": \"daily\"}, \"options\": {\"folders\": [{\"owner_user_id\": \"ownerUserId\", \"folder_id\": \"folderId\", \"limit\": 5}], \"objects\": [{\"name\": \"name\", \"limit\": 5}], \"site_collections\": [{\"site_collection_path\": \"siteCollectionPath\", \"limit\": 5}], \"urls\": [{\"url\": \"url\", \"limit_to_starting_hosts\": true, \"crawl_speed\": \"normal\", \"allow_untrusted_certificate\": false, \"maximum_hops\": 2, \"request_timeout\": 30000, \"override_robots_txt\": false, \"blacklist\": [\"blacklist\"]}], \"buckets\": [{\"name\": \"name\", \"limit\": 5}], \"crawl_all_buckets\": false}}}"; - String updateConfigurationPath = "/v1/environments/testString/configurations/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the FontSetting model - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - - // Construct an instance of the PdfHeadingDetection model - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - - // Construct an instance of the PdfSettings model - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - - // Construct an instance of the WordStyle model - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the WordHeadingDetection model - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - - // Construct an instance of the WordSettings model - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - - // Construct an instance of the XPathPatterns model - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - - // Construct an instance of the HtmlSettings model - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("testString")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the SegmentSettings model - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(false) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the NormalizationOperation model - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("copy") - .sourceField("testString") - .destinationField("testString") - .build(); - - // Construct an instance of the Conversions model - Conversions conversionsModel = - new Conversions.Builder() - .pdf(pdfSettingsModel) - .word(wordSettingsModel) - .html(htmlSettingsModel) - .segment(segmentSettingsModel) - .jsonNormalizations(java.util.Arrays.asList(normalizationOperationModel)) - .imageTextRecognition(true) - .build(); - - // Construct an instance of the NluEnrichmentKeywords model - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the NluEnrichmentEntities model - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - - // Construct an instance of the NluEnrichmentSentiment model - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the NluEnrichmentEmotion model - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the NluEnrichmentSemanticRoles model - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the NluEnrichmentRelations model - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - - // Construct an instance of the NluEnrichmentConcepts model - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - - // Construct an instance of the NluEnrichmentFeatures model - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - - // Construct an instance of the EnrichmentOptions model - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - - // Construct an instance of the Enrichment model - Enrichment enrichmentModel = - new Enrichment.Builder() - .description("testString") - .destinationField("testString") - .sourceField("testString") - .overwrite(false) - .enrichment("testString") - .ignoreDownstreamErrors(false) - .options(enrichmentOptionsModel) - .build(); - - // Construct an instance of the SourceSchedule model - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("daily") - .build(); - - // Construct an instance of the SourceOptionsFolder model - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the SourceOptionsObject model - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - - // Construct an instance of the SourceOptionsSiteColl model - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - - // Construct an instance of the SourceOptionsWebCrawl model - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the SourceOptionsBuckets model - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - - // Construct an instance of the SourceOptions model - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - - // Construct an instance of the Source model - Source sourceModel = - new Source.Builder() - .type("box") - .credentialId("testString") - .schedule(sourceScheduleModel) - .options(sourceOptionsModel) - .build(); - - // Construct an instance of the UpdateConfigurationOptions model - UpdateConfigurationOptions updateConfigurationOptionsModel = - new UpdateConfigurationOptions.Builder() - .environmentId("testString") - .configurationId("testString") - .name("testString") - .description("testString") - .conversions(conversionsModel) - .enrichments(java.util.Arrays.asList(enrichmentModel)) - .normalizations(java.util.Arrays.asList(normalizationOperationModel)) - .source(sourceModel) - .build(); - - // Invoke updateConfiguration() with a valid options model and verify the result - Response response = - discoveryService.updateConfiguration(updateConfigurationOptionsModel).execute(); - assertNotNull(response); - Configuration responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateConfigurationPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the updateConfiguration operation with and without retries enabled - @Test - public void testUpdateConfigurationWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testUpdateConfigurationWOptions(); - - discoveryService.disableRetries(); - testUpdateConfigurationWOptions(); - } - - // Test the updateConfiguration operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateConfigurationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.updateConfiguration(null).execute(); - } - - // Test the deleteConfiguration operation with a valid options model parameter - @Test - public void testDeleteConfigurationWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"configuration_id\": \"configurationId\", \"status\": \"deleted\", \"notices\": [{\"notice_id\": \"noticeId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"document_id\": \"documentId\", \"query_id\": \"queryId\", \"severity\": \"warning\", \"step\": \"step\", \"description\": \"description\"}]}"; - String deleteConfigurationPath = "/v1/environments/testString/configurations/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteConfigurationOptions model - DeleteConfigurationOptions deleteConfigurationOptionsModel = - new DeleteConfigurationOptions.Builder() - .environmentId("testString") - .configurationId("testString") - .build(); - - // Invoke deleteConfiguration() with a valid options model and verify the result - Response response = - discoveryService.deleteConfiguration(deleteConfigurationOptionsModel).execute(); - assertNotNull(response); - DeleteConfigurationResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteConfigurationPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteConfiguration operation with and without retries enabled - @Test - public void testDeleteConfigurationWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteConfigurationWOptions(); - - discoveryService.disableRetries(); - testDeleteConfigurationWOptions(); - } - - // Test the deleteConfiguration operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteConfigurationNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteConfiguration(null).execute(); - } - - // Test the createCollection operation with a valid options model parameter - @Test - public void testCreateCollectionWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"collection_id\": \"collectionId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"configuration_id\": \"configurationId\", \"language\": \"language\", \"document_counts\": {\"available\": 9, \"processing\": 10, \"failed\": 6, \"pending\": 7}, \"disk_usage\": {\"used_bytes\": 9}, \"training_status\": {\"total_examples\": 13, \"available\": false, \"processing\": true, \"minimum_queries_added\": false, \"minimum_examples_added\": true, \"sufficient_label_diversity\": true, \"notices\": 7, \"successfully_trained\": \"2019-01-01T12:00:00.000Z\", \"data_updated\": \"2019-01-01T12:00:00.000Z\"}, \"crawl_status\": {\"source_crawl\": {\"status\": \"running\", \"next_crawl\": \"2019-01-01T12:00:00.000Z\"}}, \"smart_document_understanding\": {\"enabled\": true, \"total_annotated_pages\": 19, \"total_pages\": 10, \"total_documents\": 14, \"custom_fields\": {\"defined\": 7, \"maximum_allowed\": 14}}}"; - String createCollectionPath = "/v1/environments/testString/collections"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the CreateCollectionOptions model - CreateCollectionOptions createCollectionOptionsModel = - new CreateCollectionOptions.Builder() - .environmentId("testString") - .name("testString") - .description("testString") - .configurationId("testString") - .language("en") - .build(); - - // Invoke createCollection() with a valid options model and verify the result - Response response = - discoveryService.createCollection(createCollectionOptionsModel).execute(); - assertNotNull(response); - Collection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createCollectionPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createCollection operation with and without retries enabled - @Test - public void testCreateCollectionWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateCollectionWOptions(); - - discoveryService.disableRetries(); - testCreateCollectionWOptions(); - } - - // Test the createCollection operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateCollectionNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createCollection(null).execute(); - } - - // Test the listCollections operation with a valid options model parameter - @Test - public void testListCollectionsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"collections\": [{\"collection_id\": \"collectionId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"configuration_id\": \"configurationId\", \"language\": \"language\", \"document_counts\": {\"available\": 9, \"processing\": 10, \"failed\": 6, \"pending\": 7}, \"disk_usage\": {\"used_bytes\": 9}, \"training_status\": {\"total_examples\": 13, \"available\": false, \"processing\": true, \"minimum_queries_added\": false, \"minimum_examples_added\": true, \"sufficient_label_diversity\": true, \"notices\": 7, \"successfully_trained\": \"2019-01-01T12:00:00.000Z\", \"data_updated\": \"2019-01-01T12:00:00.000Z\"}, \"crawl_status\": {\"source_crawl\": {\"status\": \"running\", \"next_crawl\": \"2019-01-01T12:00:00.000Z\"}}, \"smart_document_understanding\": {\"enabled\": true, \"total_annotated_pages\": 19, \"total_pages\": 10, \"total_documents\": 14, \"custom_fields\": {\"defined\": 7, \"maximum_allowed\": 14}}}]}"; - String listCollectionsPath = "/v1/environments/testString/collections"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListCollectionsOptions model - ListCollectionsOptions listCollectionsOptionsModel = - new ListCollectionsOptions.Builder().environmentId("testString").name("testString").build(); - - // Invoke listCollections() with a valid options model and verify the result - Response response = - discoveryService.listCollections(listCollectionsOptionsModel).execute(); - assertNotNull(response); - ListCollectionsResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listCollectionsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("name"), "testString"); - } - - // Test the listCollections operation with and without retries enabled - @Test - public void testListCollectionsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListCollectionsWOptions(); - - discoveryService.disableRetries(); - testListCollectionsWOptions(); - } - - // Test the listCollections operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListCollectionsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listCollections(null).execute(); - } - - // Test the getCollection operation with a valid options model parameter - @Test - public void testGetCollectionWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"collection_id\": \"collectionId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"configuration_id\": \"configurationId\", \"language\": \"language\", \"document_counts\": {\"available\": 9, \"processing\": 10, \"failed\": 6, \"pending\": 7}, \"disk_usage\": {\"used_bytes\": 9}, \"training_status\": {\"total_examples\": 13, \"available\": false, \"processing\": true, \"minimum_queries_added\": false, \"minimum_examples_added\": true, \"sufficient_label_diversity\": true, \"notices\": 7, \"successfully_trained\": \"2019-01-01T12:00:00.000Z\", \"data_updated\": \"2019-01-01T12:00:00.000Z\"}, \"crawl_status\": {\"source_crawl\": {\"status\": \"running\", \"next_crawl\": \"2019-01-01T12:00:00.000Z\"}}, \"smart_document_understanding\": {\"enabled\": true, \"total_annotated_pages\": 19, \"total_pages\": 10, \"total_documents\": 14, \"custom_fields\": {\"defined\": 7, \"maximum_allowed\": 14}}}"; - String getCollectionPath = "/v1/environments/testString/collections/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetCollectionOptions model - GetCollectionOptions getCollectionOptionsModel = - new GetCollectionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke getCollection() with a valid options model and verify the result - Response response = - discoveryService.getCollection(getCollectionOptionsModel).execute(); - assertNotNull(response); - Collection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getCollectionPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getCollection operation with and without retries enabled - @Test - public void testGetCollectionWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetCollectionWOptions(); - - discoveryService.disableRetries(); - testGetCollectionWOptions(); - } - - // Test the getCollection operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetCollectionNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getCollection(null).execute(); - } - - // Test the updateCollection operation with a valid options model parameter - @Test - public void testUpdateCollectionWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"collection_id\": \"collectionId\", \"name\": \"name\", \"description\": \"description\", \"created\": \"2019-01-01T12:00:00.000Z\", \"updated\": \"2019-01-01T12:00:00.000Z\", \"status\": \"active\", \"configuration_id\": \"configurationId\", \"language\": \"language\", \"document_counts\": {\"available\": 9, \"processing\": 10, \"failed\": 6, \"pending\": 7}, \"disk_usage\": {\"used_bytes\": 9}, \"training_status\": {\"total_examples\": 13, \"available\": false, \"processing\": true, \"minimum_queries_added\": false, \"minimum_examples_added\": true, \"sufficient_label_diversity\": true, \"notices\": 7, \"successfully_trained\": \"2019-01-01T12:00:00.000Z\", \"data_updated\": \"2019-01-01T12:00:00.000Z\"}, \"crawl_status\": {\"source_crawl\": {\"status\": \"running\", \"next_crawl\": \"2019-01-01T12:00:00.000Z\"}}, \"smart_document_understanding\": {\"enabled\": true, \"total_annotated_pages\": 19, \"total_pages\": 10, \"total_documents\": 14, \"custom_fields\": {\"defined\": 7, \"maximum_allowed\": 14}}}"; - String updateCollectionPath = "/v1/environments/testString/collections/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the UpdateCollectionOptions model - UpdateCollectionOptions updateCollectionOptionsModel = - new UpdateCollectionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .name("testString") - .description("testString") - .configurationId("testString") - .build(); - - // Invoke updateCollection() with a valid options model and verify the result - Response response = - discoveryService.updateCollection(updateCollectionOptionsModel).execute(); - assertNotNull(response); - Collection responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateCollectionPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the updateCollection operation with and without retries enabled - @Test - public void testUpdateCollectionWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testUpdateCollectionWOptions(); - - discoveryService.disableRetries(); - testUpdateCollectionWOptions(); - } - - // Test the updateCollection operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateCollectionNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.updateCollection(null).execute(); - } - - // Test the deleteCollection operation with a valid options model parameter - @Test - public void testDeleteCollectionWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"collection_id\": \"collectionId\", \"status\": \"deleted\"}"; - String deleteCollectionPath = "/v1/environments/testString/collections/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteCollectionOptions model - DeleteCollectionOptions deleteCollectionOptionsModel = - new DeleteCollectionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke deleteCollection() with a valid options model and verify the result - Response response = - discoveryService.deleteCollection(deleteCollectionOptionsModel).execute(); - assertNotNull(response); - DeleteCollectionResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteCollectionPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteCollection operation with and without retries enabled - @Test - public void testDeleteCollectionWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteCollectionWOptions(); - - discoveryService.disableRetries(); - testDeleteCollectionWOptions(); - } - - // Test the deleteCollection operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteCollectionNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteCollection(null).execute(); - } - - // Test the listCollectionFields operation with a valid options model parameter - @Test - public void testListCollectionFieldsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"fields\": [{\"field\": \"field\", \"type\": \"nested\"}]}"; - String listCollectionFieldsPath = "/v1/environments/testString/collections/testString/fields"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListCollectionFieldsOptions model - ListCollectionFieldsOptions listCollectionFieldsOptionsModel = - new ListCollectionFieldsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke listCollectionFields() with a valid options model and verify the result - Response response = - discoveryService.listCollectionFields(listCollectionFieldsOptionsModel).execute(); - assertNotNull(response); - ListCollectionFieldsResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listCollectionFieldsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the listCollectionFields operation with and without retries enabled - @Test - public void testListCollectionFieldsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListCollectionFieldsWOptions(); - - discoveryService.disableRetries(); - testListCollectionFieldsWOptions(); - } - - // Test the listCollectionFields operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListCollectionFieldsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listCollectionFields(null).execute(); - } - - // Test the listExpansions operation with a valid options model parameter - @Test - public void testListExpansionsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"expansions\": [{\"input_terms\": [\"inputTerms\"], \"expanded_terms\": [\"expandedTerms\"]}]}"; - String listExpansionsPath = "/v1/environments/testString/collections/testString/expansions"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListExpansionsOptions model - ListExpansionsOptions listExpansionsOptionsModel = - new ListExpansionsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke listExpansions() with a valid options model and verify the result - Response response = - discoveryService.listExpansions(listExpansionsOptionsModel).execute(); - assertNotNull(response); - Expansions responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listExpansionsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the listExpansions operation with and without retries enabled - @Test - public void testListExpansionsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListExpansionsWOptions(); - - discoveryService.disableRetries(); - testListExpansionsWOptions(); - } - - // Test the listExpansions operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListExpansionsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listExpansions(null).execute(); - } - - // Test the createExpansions operation with a valid options model parameter - @Test - public void testCreateExpansionsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"expansions\": [{\"input_terms\": [\"inputTerms\"], \"expanded_terms\": [\"expandedTerms\"]}]}"; - String createExpansionsPath = "/v1/environments/testString/collections/testString/expansions"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the Expansion model - Expansion expansionModel = - new Expansion.Builder() - .inputTerms(java.util.Arrays.asList("testString")) - .expandedTerms(java.util.Arrays.asList("testString")) - .build(); - - // Construct an instance of the CreateExpansionsOptions model - CreateExpansionsOptions createExpansionsOptionsModel = - new CreateExpansionsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .expansions(java.util.Arrays.asList(expansionModel)) - .build(); - - // Invoke createExpansions() with a valid options model and verify the result - Response response = - discoveryService.createExpansions(createExpansionsOptionsModel).execute(); - assertNotNull(response); - Expansions responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createExpansionsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createExpansions operation with and without retries enabled - @Test - public void testCreateExpansionsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateExpansionsWOptions(); - - discoveryService.disableRetries(); - testCreateExpansionsWOptions(); - } - - // Test the createExpansions operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateExpansionsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createExpansions(null).execute(); - } - - // Test the deleteExpansions operation with a valid options model parameter - @Test - public void testDeleteExpansionsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteExpansionsPath = "/v1/environments/testString/collections/testString/expansions"; - server.enqueue(new MockResponse().setResponseCode(204).setBody(mockResponseBody)); - - // Construct an instance of the DeleteExpansionsOptions model - DeleteExpansionsOptions deleteExpansionsOptionsModel = - new DeleteExpansionsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke deleteExpansions() with a valid options model and verify the result - Response response = - discoveryService.deleteExpansions(deleteExpansionsOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteExpansionsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteExpansions operation with and without retries enabled - @Test - public void testDeleteExpansionsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteExpansionsWOptions(); - - discoveryService.disableRetries(); - testDeleteExpansionsWOptions(); - } - - // Test the deleteExpansions operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteExpansionsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteExpansions(null).execute(); - } - - // Test the getTokenizationDictionaryStatus operation with a valid options model parameter - @Test - public void testGetTokenizationDictionaryStatusWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"status\": \"active\", \"type\": \"type\"}"; - String getTokenizationDictionaryStatusPath = - "/v1/environments/testString/collections/testString/word_lists/tokenization_dictionary"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetTokenizationDictionaryStatusOptions model - GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptionsModel = - new GetTokenizationDictionaryStatusOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke getTokenizationDictionaryStatus() with a valid options model and verify the result - Response response = - discoveryService - .getTokenizationDictionaryStatus(getTokenizationDictionaryStatusOptionsModel) - .execute(); - assertNotNull(response); - TokenDictStatusResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getTokenizationDictionaryStatusPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getTokenizationDictionaryStatus operation with and without retries enabled - @Test - public void testGetTokenizationDictionaryStatusWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetTokenizationDictionaryStatusWOptions(); - - discoveryService.disableRetries(); - testGetTokenizationDictionaryStatusWOptions(); - } - - // Test the getTokenizationDictionaryStatus operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTokenizationDictionaryStatusNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getTokenizationDictionaryStatus(null).execute(); - } - - // Test the createTokenizationDictionary operation with a valid options model parameter - @Test - public void testCreateTokenizationDictionaryWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"status\": \"active\", \"type\": \"type\"}"; - String createTokenizationDictionaryPath = - "/v1/environments/testString/collections/testString/word_lists/tokenization_dictionary"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) - .setBody(mockResponseBody)); - - // Construct an instance of the TokenDictRule model - TokenDictRule tokenDictRuleModel = - new TokenDictRule.Builder() - .text("testString") - .tokens(java.util.Arrays.asList("testString")) - .readings(java.util.Arrays.asList("testString")) - .partOfSpeech("testString") - .build(); - - // Construct an instance of the CreateTokenizationDictionaryOptions model - CreateTokenizationDictionaryOptions createTokenizationDictionaryOptionsModel = - new CreateTokenizationDictionaryOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .tokenizationRules(java.util.Arrays.asList(tokenDictRuleModel)) - .build(); - - // Invoke createTokenizationDictionary() with a valid options model and verify the result - Response response = - discoveryService - .createTokenizationDictionary(createTokenizationDictionaryOptionsModel) - .execute(); - assertNotNull(response); - TokenDictStatusResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createTokenizationDictionaryPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createTokenizationDictionary operation with and without retries enabled - @Test - public void testCreateTokenizationDictionaryWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateTokenizationDictionaryWOptions(); - - discoveryService.disableRetries(); - testCreateTokenizationDictionaryWOptions(); - } - - // Test the createTokenizationDictionary operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateTokenizationDictionaryNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createTokenizationDictionary(null).execute(); - } - - // Test the deleteTokenizationDictionary operation with a valid options model parameter - @Test - public void testDeleteTokenizationDictionaryWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteTokenizationDictionaryPath = - "/v1/environments/testString/collections/testString/word_lists/tokenization_dictionary"; - server.enqueue(new MockResponse().setResponseCode(200).setBody(mockResponseBody)); - - // Construct an instance of the DeleteTokenizationDictionaryOptions model - DeleteTokenizationDictionaryOptions deleteTokenizationDictionaryOptionsModel = - new DeleteTokenizationDictionaryOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke deleteTokenizationDictionary() with a valid options model and verify the result - Response response = - discoveryService - .deleteTokenizationDictionary(deleteTokenizationDictionaryOptionsModel) - .execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteTokenizationDictionaryPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteTokenizationDictionary operation with and without retries enabled - @Test - public void testDeleteTokenizationDictionaryWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteTokenizationDictionaryWOptions(); - - discoveryService.disableRetries(); - testDeleteTokenizationDictionaryWOptions(); - } - - // Test the deleteTokenizationDictionary operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteTokenizationDictionaryNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteTokenizationDictionary(null).execute(); - } - - // Test the getStopwordListStatus operation with a valid options model parameter - @Test - public void testGetStopwordListStatusWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"status\": \"active\", \"type\": \"type\"}"; - String getStopwordListStatusPath = - "/v1/environments/testString/collections/testString/word_lists/stopwords"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetStopwordListStatusOptions model - GetStopwordListStatusOptions getStopwordListStatusOptionsModel = - new GetStopwordListStatusOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke getStopwordListStatus() with a valid options model and verify the result - Response response = - discoveryService.getStopwordListStatus(getStopwordListStatusOptionsModel).execute(); - assertNotNull(response); - TokenDictStatusResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getStopwordListStatusPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getStopwordListStatus operation with and without retries enabled - @Test - public void testGetStopwordListStatusWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetStopwordListStatusWOptions(); - - discoveryService.disableRetries(); - testGetStopwordListStatusWOptions(); - } - - // Test the getStopwordListStatus operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetStopwordListStatusNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getStopwordListStatus(null).execute(); - } - - // Test the createStopwordList operation with a valid options model parameter - @Test - public void testCreateStopwordListWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"status\": \"active\", \"type\": \"type\"}"; - String createStopwordListPath = - "/v1/environments/testString/collections/testString/word_lists/stopwords"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the CreateStopwordListOptions model - CreateStopwordListOptions createStopwordListOptionsModel = - new CreateStopwordListOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .stopwordFile(TestUtilities.createMockStream("This is a mock file.")) - .stopwordFilename("testString") - .build(); - - // Invoke createStopwordList() with a valid options model and verify the result - Response response = - discoveryService.createStopwordList(createStopwordListOptionsModel).execute(); - assertNotNull(response); - TokenDictStatusResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createStopwordListPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createStopwordList operation with and without retries enabled - @Test - public void testCreateStopwordListWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateStopwordListWOptions(); - - discoveryService.disableRetries(); - testCreateStopwordListWOptions(); - } - - // Test the createStopwordList operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateStopwordListNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createStopwordList(null).execute(); - } - - // Test the deleteStopwordList operation with a valid options model parameter - @Test - public void testDeleteStopwordListWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteStopwordListPath = - "/v1/environments/testString/collections/testString/word_lists/stopwords"; - server.enqueue(new MockResponse().setResponseCode(200).setBody(mockResponseBody)); - - // Construct an instance of the DeleteStopwordListOptions model - DeleteStopwordListOptions deleteStopwordListOptionsModel = - new DeleteStopwordListOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke deleteStopwordList() with a valid options model and verify the result - Response response = - discoveryService.deleteStopwordList(deleteStopwordListOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteStopwordListPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteStopwordList operation with and without retries enabled - @Test - public void testDeleteStopwordListWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteStopwordListWOptions(); - - discoveryService.disableRetries(); - testDeleteStopwordListWOptions(); - } - - // Test the deleteStopwordList operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteStopwordListNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteStopwordList(null).execute(); - } - - // Test the addDocument operation with a valid options model parameter - @Test - public void testAddDocumentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"status\": \"processing\", \"notices\": [{\"notice_id\": \"noticeId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"document_id\": \"documentId\", \"query_id\": \"queryId\", \"severity\": \"warning\", \"step\": \"step\", \"description\": \"description\"}]}"; - String addDocumentPath = "/v1/environments/testString/collections/testString/documents"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) - .setBody(mockResponseBody)); - - // Construct an instance of the AddDocumentOptions model - AddDocumentOptions addDocumentOptionsModel = - new AddDocumentOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .file(TestUtilities.createMockStream("This is a mock file.")) - .filename("testString") - .fileContentType("application/json") - .metadata("testString") - .build(); - - // Invoke addDocument() with a valid options model and verify the result - Response response = - discoveryService.addDocument(addDocumentOptionsModel).execute(); - assertNotNull(response); - DocumentAccepted responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addDocumentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the addDocument operation with and without retries enabled - @Test - public void testAddDocumentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testAddDocumentWOptions(); - - discoveryService.disableRetries(); - testAddDocumentWOptions(); - } - - // Test the addDocument operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddDocumentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.addDocument(null).execute(); - } - - // Test the getDocumentStatus operation with a valid options model parameter - @Test - public void testGetDocumentStatusWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"configuration_id\": \"configurationId\", \"status\": \"available\", \"status_description\": \"statusDescription\", \"filename\": \"filename\", \"file_type\": \"pdf\", \"sha1\": \"sha1\", \"notices\": [{\"notice_id\": \"noticeId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"document_id\": \"documentId\", \"query_id\": \"queryId\", \"severity\": \"warning\", \"step\": \"step\", \"description\": \"description\"}]}"; - String getDocumentStatusPath = - "/v1/environments/testString/collections/testString/documents/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetDocumentStatusOptions model - GetDocumentStatusOptions getDocumentStatusOptionsModel = - new GetDocumentStatusOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .documentId("testString") - .build(); - - // Invoke getDocumentStatus() with a valid options model and verify the result - Response response = - discoveryService.getDocumentStatus(getDocumentStatusOptionsModel).execute(); - assertNotNull(response); - DocumentStatus responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getDocumentStatusPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getDocumentStatus operation with and without retries enabled - @Test - public void testGetDocumentStatusWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetDocumentStatusWOptions(); - - discoveryService.disableRetries(); - testGetDocumentStatusWOptions(); - } - - // Test the getDocumentStatus operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDocumentStatusNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getDocumentStatus(null).execute(); - } - - // Test the updateDocument operation with a valid options model parameter - @Test - public void testUpdateDocumentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"status\": \"processing\", \"notices\": [{\"notice_id\": \"noticeId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"document_id\": \"documentId\", \"query_id\": \"queryId\", \"severity\": \"warning\", \"step\": \"step\", \"description\": \"description\"}]}"; - String updateDocumentPath = - "/v1/environments/testString/collections/testString/documents/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) - .setBody(mockResponseBody)); - - // Construct an instance of the UpdateDocumentOptions model - UpdateDocumentOptions updateDocumentOptionsModel = - new UpdateDocumentOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .documentId("testString") - .file(TestUtilities.createMockStream("This is a mock file.")) - .filename("testString") - .fileContentType("application/json") - .metadata("testString") - .build(); - - // Invoke updateDocument() with a valid options model and verify the result - Response response = - discoveryService.updateDocument(updateDocumentOptionsModel).execute(); - assertNotNull(response); - DocumentAccepted responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateDocumentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the updateDocument operation with and without retries enabled - @Test - public void testUpdateDocumentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testUpdateDocumentWOptions(); - - discoveryService.disableRetries(); - testUpdateDocumentWOptions(); - } - - // Test the updateDocument operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateDocumentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.updateDocument(null).execute(); - } - - // Test the deleteDocument operation with a valid options model parameter - @Test - public void testDeleteDocumentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"document_id\": \"documentId\", \"status\": \"deleted\"}"; - String deleteDocumentPath = - "/v1/environments/testString/collections/testString/documents/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteDocumentOptions model - DeleteDocumentOptions deleteDocumentOptionsModel = - new DeleteDocumentOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .documentId("testString") - .build(); - - // Invoke deleteDocument() with a valid options model and verify the result - Response response = - discoveryService.deleteDocument(deleteDocumentOptionsModel).execute(); - assertNotNull(response); - DeleteDocumentResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteDocumentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteDocument operation with and without retries enabled - @Test - public void testDeleteDocumentWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteDocumentWOptions(); - - discoveryService.disableRetries(); - testDeleteDocumentWOptions(); - } - - // Test the deleteDocument operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteDocumentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteDocument(null).execute(); - } - - // Test the query operation with a valid options model parameter - @Test - public void testQueryWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"matching_results\": 15, \"results\": [{\"id\": \"id\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"collection_id\": \"collectionId\", \"result_metadata\": {\"score\": 5, \"confidence\": 10}}], \"aggregations\": [{\"type\": \"filter\", \"match\": \"match\", \"matching_results\": 15}], \"passages\": [{\"document_id\": \"documentId\", \"passage_score\": 12, \"passage_text\": \"passageText\", \"start_offset\": 11, \"end_offset\": 9, \"field\": \"field\"}], \"duplicates_removed\": 17, \"session_token\": \"sessionToken\", \"retrieval_details\": {\"document_retrieval_strategy\": \"untrained\"}, \"suggested_query\": \"suggestedQuery\"}"; - String queryPath = "/v1/environments/testString/collections/testString/query"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the QueryOptions model - QueryOptions queryOptionsModel = - new QueryOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .passages(true) - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn("testString") - .offset(Long.valueOf("26")) - .sort("testString") - .highlight(false) - .passagesFields("testString") - .passagesCount(Long.valueOf("10")) - .passagesCharacters(Long.valueOf("400")) - .deduplicate(false) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds("testString") - .similarFields("testString") - .bias("testString") - .spellingSuggestions(false) - .xWatsonLoggingOptOut(false) - .build(); - - // Invoke query() with a valid options model and verify the result - Response response = discoveryService.query(queryOptionsModel).execute(); - assertNotNull(response); - QueryResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, queryPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the query operation with and without retries enabled - @Test - public void testQueryWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testQueryWOptions(); - - discoveryService.disableRetries(); - testQueryWOptions(); - } - - // Test the query operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testQueryNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.query(null).execute(); - } - - // Test the queryNotices operation with a valid options model parameter - @Test - public void testQueryNoticesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"matching_results\": 15, \"results\": [{\"id\": \"id\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"collection_id\": \"collectionId\", \"result_metadata\": {\"score\": 5, \"confidence\": 10}, \"code\": 4, \"filename\": \"filename\", \"file_type\": \"pdf\", \"sha1\": \"sha1\", \"notices\": [{\"notice_id\": \"noticeId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"document_id\": \"documentId\", \"query_id\": \"queryId\", \"severity\": \"warning\", \"step\": \"step\", \"description\": \"description\"}]}], \"aggregations\": [{\"type\": \"filter\", \"match\": \"match\", \"matching_results\": 15}], \"passages\": [{\"document_id\": \"documentId\", \"passage_score\": 12, \"passage_text\": \"passageText\", \"start_offset\": 11, \"end_offset\": 9, \"field\": \"field\"}], \"duplicates_removed\": 17}"; - String queryNoticesPath = "/v1/environments/testString/collections/testString/notices"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the QueryNoticesOptions model - QueryNoticesOptions queryNoticesOptionsModel = - new QueryNoticesOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .passages(true) - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn(java.util.Arrays.asList("testString")) - .offset(Long.valueOf("26")) - .sort(java.util.Arrays.asList("testString")) - .highlight(false) - .passagesFields(java.util.Arrays.asList("testString")) - .passagesCount(Long.valueOf("10")) - .passagesCharacters(Long.valueOf("400")) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds(java.util.Arrays.asList("testString")) - .similarFields(java.util.Arrays.asList("testString")) - .build(); - - // Invoke queryNotices() with a valid options model and verify the result - Response response = - discoveryService.queryNotices(queryNoticesOptionsModel).execute(); - assertNotNull(response); - QueryNoticesResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, queryNoticesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("filter"), "testString"); - assertEquals(query.get("query"), "testString"); - assertEquals(query.get("natural_language_query"), "testString"); - assertEquals(Boolean.valueOf(query.get("passages")), Boolean.valueOf(true)); - assertEquals(query.get("aggregation"), "testString"); - assertEquals(Long.valueOf(query.get("count")), Long.valueOf("10")); - assertEquals( - query.get("return"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals(Long.valueOf(query.get("offset")), Long.valueOf("26")); - assertEquals(query.get("sort"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals(Boolean.valueOf(query.get("highlight")), Boolean.valueOf(false)); - assertEquals( - query.get("passages.fields"), - RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals(Long.valueOf(query.get("passages.count")), Long.valueOf("10")); - assertEquals(Long.valueOf(query.get("passages.characters")), Long.valueOf("400")); - assertEquals(query.get("deduplicate.field"), "testString"); - assertEquals(Boolean.valueOf(query.get("similar")), Boolean.valueOf(false)); - assertEquals( - query.get("similar.document_ids"), - RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals( - query.get("similar.fields"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - } - - // Test the queryNotices operation with and without retries enabled - @Test - public void testQueryNoticesWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testQueryNoticesWOptions(); - - discoveryService.disableRetries(); - testQueryNoticesWOptions(); - } - - // Test the queryNotices operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testQueryNoticesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.queryNotices(null).execute(); - } - - // Test the federatedQuery operation with a valid options model parameter - @Test - public void testFederatedQueryWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"matching_results\": 15, \"results\": [{\"id\": \"id\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"collection_id\": \"collectionId\", \"result_metadata\": {\"score\": 5, \"confidence\": 10}}], \"aggregations\": [{\"type\": \"filter\", \"match\": \"match\", \"matching_results\": 15}], \"passages\": [{\"document_id\": \"documentId\", \"passage_score\": 12, \"passage_text\": \"passageText\", \"start_offset\": 11, \"end_offset\": 9, \"field\": \"field\"}], \"duplicates_removed\": 17, \"session_token\": \"sessionToken\", \"retrieval_details\": {\"document_retrieval_strategy\": \"untrained\"}, \"suggested_query\": \"suggestedQuery\"}"; - String federatedQueryPath = "/v1/environments/testString/query"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the FederatedQueryOptions model - FederatedQueryOptions federatedQueryOptionsModel = - new FederatedQueryOptions.Builder() - .environmentId("testString") - .collectionIds("testString") - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .passages(true) - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn("testString") - .offset(Long.valueOf("26")) - .sort("testString") - .highlight(false) - .passagesFields("testString") - .passagesCount(Long.valueOf("10")) - .passagesCharacters(Long.valueOf("400")) - .deduplicate(false) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds("testString") - .similarFields("testString") - .bias("testString") - .xWatsonLoggingOptOut(false) - .build(); - - // Invoke federatedQuery() with a valid options model and verify the result - Response response = - discoveryService.federatedQuery(federatedQueryOptionsModel).execute(); - assertNotNull(response); - QueryResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, federatedQueryPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the federatedQuery operation with and without retries enabled - @Test - public void testFederatedQueryWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testFederatedQueryWOptions(); - - discoveryService.disableRetries(); - testFederatedQueryWOptions(); - } - - // Test the federatedQuery operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testFederatedQueryNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.federatedQuery(null).execute(); - } - - // Test the federatedQueryNotices operation with a valid options model parameter - @Test - public void testFederatedQueryNoticesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"matching_results\": 15, \"results\": [{\"id\": \"id\", \"metadata\": {\"anyKey\": \"anyValue\"}, \"collection_id\": \"collectionId\", \"result_metadata\": {\"score\": 5, \"confidence\": 10}, \"code\": 4, \"filename\": \"filename\", \"file_type\": \"pdf\", \"sha1\": \"sha1\", \"notices\": [{\"notice_id\": \"noticeId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"document_id\": \"documentId\", \"query_id\": \"queryId\", \"severity\": \"warning\", \"step\": \"step\", \"description\": \"description\"}]}], \"aggregations\": [{\"type\": \"filter\", \"match\": \"match\", \"matching_results\": 15}], \"passages\": [{\"document_id\": \"documentId\", \"passage_score\": 12, \"passage_text\": \"passageText\", \"start_offset\": 11, \"end_offset\": 9, \"field\": \"field\"}], \"duplicates_removed\": 17}"; - String federatedQueryNoticesPath = "/v1/environments/testString/notices"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the FederatedQueryNoticesOptions model - FederatedQueryNoticesOptions federatedQueryNoticesOptionsModel = - new FederatedQueryNoticesOptions.Builder() - .environmentId("testString") - .collectionIds(java.util.Arrays.asList("testString")) - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn(java.util.Arrays.asList("testString")) - .offset(Long.valueOf("26")) - .sort(java.util.Arrays.asList("testString")) - .highlight(false) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds(java.util.Arrays.asList("testString")) - .similarFields(java.util.Arrays.asList("testString")) - .build(); - - // Invoke federatedQueryNotices() with a valid options model and verify the result - Response response = - discoveryService.federatedQueryNotices(federatedQueryNoticesOptionsModel).execute(); - assertNotNull(response); - QueryNoticesResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, federatedQueryNoticesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals( - query.get("collection_ids"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals(query.get("filter"), "testString"); - assertEquals(query.get("query"), "testString"); - assertEquals(query.get("natural_language_query"), "testString"); - assertEquals(query.get("aggregation"), "testString"); - assertEquals(Long.valueOf(query.get("count")), Long.valueOf("10")); - assertEquals( - query.get("return"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals(Long.valueOf(query.get("offset")), Long.valueOf("26")); - assertEquals(query.get("sort"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals(Boolean.valueOf(query.get("highlight")), Boolean.valueOf(false)); - assertEquals(query.get("deduplicate.field"), "testString"); - assertEquals(Boolean.valueOf(query.get("similar")), Boolean.valueOf(false)); - assertEquals( - query.get("similar.document_ids"), - RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - assertEquals( - query.get("similar.fields"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - } - - // Test the federatedQueryNotices operation with and without retries enabled - @Test - public void testFederatedQueryNoticesWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testFederatedQueryNoticesWOptions(); - - discoveryService.disableRetries(); - testFederatedQueryNoticesWOptions(); - } - - // Test the federatedQueryNotices operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testFederatedQueryNoticesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.federatedQueryNotices(null).execute(); - } - - // Test the getAutocompletion operation with a valid options model parameter - @Test - public void testGetAutocompletionWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"completions\": [\"completions\"]}"; - String getAutocompletionPath = - "/v1/environments/testString/collections/testString/autocompletion"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetAutocompletionOptions model - GetAutocompletionOptions getAutocompletionOptionsModel = - new GetAutocompletionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .prefix("testString") - .field("testString") - .count(Long.valueOf("5")) - .build(); - - // Invoke getAutocompletion() with a valid options model and verify the result - Response response = - discoveryService.getAutocompletion(getAutocompletionOptionsModel).execute(); - assertNotNull(response); - Completions responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getAutocompletionPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("prefix"), "testString"); - assertEquals(query.get("field"), "testString"); - assertEquals(Long.valueOf(query.get("count")), Long.valueOf("5")); - } - - // Test the getAutocompletion operation with and without retries enabled - @Test - public void testGetAutocompletionWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetAutocompletionWOptions(); - - discoveryService.disableRetries(); - testGetAutocompletionWOptions(); - } - - // Test the getAutocompletion operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetAutocompletionNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getAutocompletion(null).execute(); - } - - // Test the listTrainingData operation with a valid options model parameter - @Test - public void testListTrainingDataWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"environment_id\": \"environmentId\", \"collection_id\": \"collectionId\", \"queries\": [{\"query_id\": \"queryId\", \"natural_language_query\": \"naturalLanguageQuery\", \"filter\": \"filter\", \"examples\": [{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}]}]}"; - String listTrainingDataPath = - "/v1/environments/testString/collections/testString/training_data"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListTrainingDataOptions model - ListTrainingDataOptions listTrainingDataOptionsModel = - new ListTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke listTrainingData() with a valid options model and verify the result - Response response = - discoveryService.listTrainingData(listTrainingDataOptionsModel).execute(); - assertNotNull(response); - TrainingDataSet responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listTrainingDataPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the listTrainingData operation with and without retries enabled - @Test - public void testListTrainingDataWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListTrainingDataWOptions(); - - discoveryService.disableRetries(); - testListTrainingDataWOptions(); - } - - // Test the listTrainingData operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListTrainingDataNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listTrainingData(null).execute(); - } - - // Test the addTrainingData operation with a valid options model parameter - @Test - public void testAddTrainingDataWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"query_id\": \"queryId\", \"natural_language_query\": \"naturalLanguageQuery\", \"filter\": \"filter\", \"examples\": [{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}]}"; - String addTrainingDataPath = "/v1/environments/testString/collections/testString/training_data"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the TrainingExample model - TrainingExample trainingExampleModel = - new TrainingExample.Builder() - .documentId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - - // Construct an instance of the AddTrainingDataOptions model - AddTrainingDataOptions addTrainingDataOptionsModel = - new AddTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .naturalLanguageQuery("testString") - .filter("testString") - .examples(java.util.Arrays.asList(trainingExampleModel)) - .build(); - - // Invoke addTrainingData() with a valid options model and verify the result - Response response = - discoveryService.addTrainingData(addTrainingDataOptionsModel).execute(); - assertNotNull(response); - TrainingQuery responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, addTrainingDataPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the addTrainingData operation with and without retries enabled - @Test - public void testAddTrainingDataWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testAddTrainingDataWOptions(); - - discoveryService.disableRetries(); - testAddTrainingDataWOptions(); - } - - // Test the addTrainingData operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddTrainingDataNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.addTrainingData(null).execute(); - } - - // Test the deleteAllTrainingData operation with a valid options model parameter - @Test - public void testDeleteAllTrainingDataWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteAllTrainingDataPath = - "/v1/environments/testString/collections/testString/training_data"; - server.enqueue(new MockResponse().setResponseCode(204).setBody(mockResponseBody)); - - // Construct an instance of the DeleteAllTrainingDataOptions model - DeleteAllTrainingDataOptions deleteAllTrainingDataOptionsModel = - new DeleteAllTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - - // Invoke deleteAllTrainingData() with a valid options model and verify the result - Response response = - discoveryService.deleteAllTrainingData(deleteAllTrainingDataOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteAllTrainingDataPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteAllTrainingData operation with and without retries enabled - @Test - public void testDeleteAllTrainingDataWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteAllTrainingDataWOptions(); - - discoveryService.disableRetries(); - testDeleteAllTrainingDataWOptions(); - } - - // Test the deleteAllTrainingData operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteAllTrainingDataNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteAllTrainingData(null).execute(); - } - - // Test the getTrainingData operation with a valid options model parameter - @Test - public void testGetTrainingDataWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"query_id\": \"queryId\", \"natural_language_query\": \"naturalLanguageQuery\", \"filter\": \"filter\", \"examples\": [{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}]}"; - String getTrainingDataPath = - "/v1/environments/testString/collections/testString/training_data/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetTrainingDataOptions model - GetTrainingDataOptions getTrainingDataOptionsModel = - new GetTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .build(); - - // Invoke getTrainingData() with a valid options model and verify the result - Response response = - discoveryService.getTrainingData(getTrainingDataOptionsModel).execute(); - assertNotNull(response); - TrainingQuery responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getTrainingDataPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getTrainingData operation with and without retries enabled - @Test - public void testGetTrainingDataWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetTrainingDataWOptions(); - - discoveryService.disableRetries(); - testGetTrainingDataWOptions(); - } - - // Test the getTrainingData operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTrainingDataNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getTrainingData(null).execute(); - } - - // Test the deleteTrainingData operation with a valid options model parameter - @Test - public void testDeleteTrainingDataWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteTrainingDataPath = - "/v1/environments/testString/collections/testString/training_data/testString"; - server.enqueue(new MockResponse().setResponseCode(204).setBody(mockResponseBody)); - - // Construct an instance of the DeleteTrainingDataOptions model - DeleteTrainingDataOptions deleteTrainingDataOptionsModel = - new DeleteTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .build(); - - // Invoke deleteTrainingData() with a valid options model and verify the result - Response response = - discoveryService.deleteTrainingData(deleteTrainingDataOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteTrainingDataPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteTrainingData operation with and without retries enabled - @Test - public void testDeleteTrainingDataWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteTrainingDataWOptions(); - - discoveryService.disableRetries(); - testDeleteTrainingDataWOptions(); - } - - // Test the deleteTrainingData operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteTrainingDataNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteTrainingData(null).execute(); - } - - // Test the listTrainingExamples operation with a valid options model parameter - @Test - public void testListTrainingExamplesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"examples\": [{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}]}"; - String listTrainingExamplesPath = - "/v1/environments/testString/collections/testString/training_data/testString/examples"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListTrainingExamplesOptions model - ListTrainingExamplesOptions listTrainingExamplesOptionsModel = - new ListTrainingExamplesOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .build(); - - // Invoke listTrainingExamples() with a valid options model and verify the result - Response response = - discoveryService.listTrainingExamples(listTrainingExamplesOptionsModel).execute(); - assertNotNull(response); - TrainingExampleList responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listTrainingExamplesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the listTrainingExamples operation with and without retries enabled - @Test - public void testListTrainingExamplesWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListTrainingExamplesWOptions(); - - discoveryService.disableRetries(); - testListTrainingExamplesWOptions(); - } - - // Test the listTrainingExamples operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListTrainingExamplesNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listTrainingExamples(null).execute(); - } - - // Test the createTrainingExample operation with a valid options model parameter - @Test - public void testCreateTrainingExampleWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}"; - String createTrainingExamplePath = - "/v1/environments/testString/collections/testString/training_data/testString/examples"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the CreateTrainingExampleOptions model - CreateTrainingExampleOptions createTrainingExampleOptionsModel = - new CreateTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .documentId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - - // Invoke createTrainingExample() with a valid options model and verify the result - Response response = - discoveryService.createTrainingExample(createTrainingExampleOptionsModel).execute(); - assertNotNull(response); - TrainingExample responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createTrainingExamplePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createTrainingExample operation with and without retries enabled - @Test - public void testCreateTrainingExampleWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateTrainingExampleWOptions(); - - discoveryService.disableRetries(); - testCreateTrainingExampleWOptions(); - } - - // Test the createTrainingExample operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateTrainingExampleNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createTrainingExample(null).execute(); - } - - // Test the deleteTrainingExample operation with a valid options model parameter - @Test - public void testDeleteTrainingExampleWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteTrainingExamplePath = - "/v1/environments/testString/collections/testString/training_data/testString/examples/testString"; - server.enqueue(new MockResponse().setResponseCode(204).setBody(mockResponseBody)); - - // Construct an instance of the DeleteTrainingExampleOptions model - DeleteTrainingExampleOptions deleteTrainingExampleOptionsModel = - new DeleteTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .exampleId("testString") - .build(); - - // Invoke deleteTrainingExample() with a valid options model and verify the result - Response response = - discoveryService.deleteTrainingExample(deleteTrainingExampleOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteTrainingExamplePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteTrainingExample operation with and without retries enabled - @Test - public void testDeleteTrainingExampleWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteTrainingExampleWOptions(); - - discoveryService.disableRetries(); - testDeleteTrainingExampleWOptions(); - } - - // Test the deleteTrainingExample operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteTrainingExampleNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteTrainingExample(null).execute(); - } - - // Test the updateTrainingExample operation with a valid options model parameter - @Test - public void testUpdateTrainingExampleWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}"; - String updateTrainingExamplePath = - "/v1/environments/testString/collections/testString/training_data/testString/examples/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the UpdateTrainingExampleOptions model - UpdateTrainingExampleOptions updateTrainingExampleOptionsModel = - new UpdateTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .exampleId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - - // Invoke updateTrainingExample() with a valid options model and verify the result - Response response = - discoveryService.updateTrainingExample(updateTrainingExampleOptionsModel).execute(); - assertNotNull(response); - TrainingExample responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateTrainingExamplePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the updateTrainingExample operation with and without retries enabled - @Test - public void testUpdateTrainingExampleWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testUpdateTrainingExampleWOptions(); - - discoveryService.disableRetries(); - testUpdateTrainingExampleWOptions(); - } - - // Test the updateTrainingExample operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateTrainingExampleNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.updateTrainingExample(null).execute(); - } - - // Test the getTrainingExample operation with a valid options model parameter - @Test - public void testGetTrainingExampleWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"cross_reference\": \"crossReference\", \"relevance\": 9}"; - String getTrainingExamplePath = - "/v1/environments/testString/collections/testString/training_data/testString/examples/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetTrainingExampleOptions model - GetTrainingExampleOptions getTrainingExampleOptionsModel = - new GetTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .exampleId("testString") - .build(); - - // Invoke getTrainingExample() with a valid options model and verify the result - Response response = - discoveryService.getTrainingExample(getTrainingExampleOptionsModel).execute(); - assertNotNull(response); - TrainingExample responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getTrainingExamplePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getTrainingExample operation with and without retries enabled - @Test - public void testGetTrainingExampleWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetTrainingExampleWOptions(); - - discoveryService.disableRetries(); - testGetTrainingExampleWOptions(); - } - - // Test the getTrainingExample operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTrainingExampleNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getTrainingExample(null).execute(); - } - - // Test the deleteUserData operation with a valid options model parameter - @Test - public void testDeleteUserDataWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteUserDataPath = "/v1/user_data"; - server.enqueue(new MockResponse().setResponseCode(200).setBody(mockResponseBody)); - - // Construct an instance of the DeleteUserDataOptions model - DeleteUserDataOptions deleteUserDataOptionsModel = - new DeleteUserDataOptions.Builder().customerId("testString").build(); - - // Invoke deleteUserData() with a valid options model and verify the result - Response response = discoveryService.deleteUserData(deleteUserDataOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteUserDataPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("customer_id"), "testString"); - } - - // Test the deleteUserData operation with and without retries enabled - @Test - public void testDeleteUserDataWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteUserDataWOptions(); - - discoveryService.disableRetries(); - testDeleteUserDataWOptions(); - } - - // Test the deleteUserData operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteUserDataNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteUserData(null).execute(); - } - - // Test the createEvent operation with a valid options model parameter - @Test - public void testCreateEventWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"type\": \"click\", \"data\": {\"environment_id\": \"environmentId\", \"session_token\": \"sessionToken\", \"client_timestamp\": \"2019-01-01T12:00:00.000Z\", \"display_rank\": 11, \"collection_id\": \"collectionId\", \"document_id\": \"documentId\", \"query_id\": \"queryId\"}}"; - String createEventPath = "/v1/events"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(201) - .setBody(mockResponseBody)); - - // Construct an instance of the EventData model - EventData eventDataModel = - new EventData.Builder() - .environmentId("testString") - .sessionToken("testString") - .clientTimestamp(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .displayRank(Long.valueOf("26")) - .collectionId("testString") - .documentId("testString") - .build(); - - // Construct an instance of the CreateEventOptions model - CreateEventOptions createEventOptionsModel = - new CreateEventOptions.Builder().type("click").data(eventDataModel).build(); - - // Invoke createEvent() with a valid options model and verify the result - Response response = - discoveryService.createEvent(createEventOptionsModel).execute(); - assertNotNull(response); - CreateEventResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createEventPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createEvent operation with and without retries enabled - @Test - public void testCreateEventWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateEventWOptions(); - - discoveryService.disableRetries(); - testCreateEventWOptions(); - } - - // Test the createEvent operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateEventNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createEvent(null).execute(); - } - - // Test the queryLog operation with a valid options model parameter - @Test - public void testQueryLogWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"matching_results\": 15, \"results\": [{\"environment_id\": \"environmentId\", \"customer_id\": \"customerId\", \"document_type\": \"query\", \"natural_language_query\": \"naturalLanguageQuery\", \"document_results\": {\"results\": [{\"position\": 8, \"document_id\": \"documentId\", \"score\": 5, \"confidence\": 10, \"collection_id\": \"collectionId\"}], \"count\": 5}, \"created_timestamp\": \"2019-01-01T12:00:00.000Z\", \"client_timestamp\": \"2019-01-01T12:00:00.000Z\", \"query_id\": \"queryId\", \"session_token\": \"sessionToken\", \"collection_id\": \"collectionId\", \"display_rank\": 11, \"document_id\": \"documentId\", \"event_type\": \"click\", \"result_type\": \"document\"}]}"; - String queryLogPath = "/v1/logs"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the QueryLogOptions model - QueryLogOptions queryLogOptionsModel = - new QueryLogOptions.Builder() - .filter("testString") - .query("testString") - .count(Long.valueOf("10")) - .offset(Long.valueOf("26")) - .sort(java.util.Arrays.asList("testString")) - .build(); - - // Invoke queryLog() with a valid options model and verify the result - Response response = discoveryService.queryLog(queryLogOptionsModel).execute(); - assertNotNull(response); - LogQueryResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, queryLogPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("filter"), "testString"); - assertEquals(query.get("query"), "testString"); - assertEquals(Long.valueOf(query.get("count")), Long.valueOf("10")); - assertEquals(Long.valueOf(query.get("offset")), Long.valueOf("26")); - assertEquals(query.get("sort"), RequestUtils.join(java.util.Arrays.asList("testString"), ",")); - } - - // Test the queryLog operation with and without retries enabled - @Test - public void testQueryLogWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testQueryLogWOptions(); - - discoveryService.disableRetries(); - testQueryLogWOptions(); - } - - // Test the getMetricsQuery operation with a valid options model parameter - @Test - public void testGetMetricsQueryWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"aggregations\": [{\"interval\": \"interval\", \"event_type\": \"eventType\", \"results\": [{\"key_as_string\": \"2019-01-01T12:00:00.000Z\", \"key\": 3, \"matching_results\": 15, \"event_rate\": 9}]}]}"; - String getMetricsQueryPath = "/v1/metrics/number_of_queries"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetMetricsQueryOptions model - GetMetricsQueryOptions getMetricsQueryOptionsModel = - new GetMetricsQueryOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - - // Invoke getMetricsQuery() with a valid options model and verify the result - Response response = - discoveryService.getMetricsQuery(getMetricsQueryOptionsModel).execute(); - assertNotNull(response); - MetricResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getMetricsQueryPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("result_type"), "document"); - } - - // Test the getMetricsQuery operation with and without retries enabled - @Test - public void testGetMetricsQueryWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetMetricsQueryWOptions(); - - discoveryService.disableRetries(); - testGetMetricsQueryWOptions(); - } - - // Test the getMetricsQueryEvent operation with a valid options model parameter - @Test - public void testGetMetricsQueryEventWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"aggregations\": [{\"interval\": \"interval\", \"event_type\": \"eventType\", \"results\": [{\"key_as_string\": \"2019-01-01T12:00:00.000Z\", \"key\": 3, \"matching_results\": 15, \"event_rate\": 9}]}]}"; - String getMetricsQueryEventPath = "/v1/metrics/number_of_queries_with_event"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetMetricsQueryEventOptions model - GetMetricsQueryEventOptions getMetricsQueryEventOptionsModel = - new GetMetricsQueryEventOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - - // Invoke getMetricsQueryEvent() with a valid options model and verify the result - Response response = - discoveryService.getMetricsQueryEvent(getMetricsQueryEventOptionsModel).execute(); - assertNotNull(response); - MetricResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getMetricsQueryEventPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("result_type"), "document"); - } - - // Test the getMetricsQueryEvent operation with and without retries enabled - @Test - public void testGetMetricsQueryEventWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetMetricsQueryEventWOptions(); - - discoveryService.disableRetries(); - testGetMetricsQueryEventWOptions(); - } - - // Test the getMetricsQueryNoResults operation with a valid options model parameter - @Test - public void testGetMetricsQueryNoResultsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"aggregations\": [{\"interval\": \"interval\", \"event_type\": \"eventType\", \"results\": [{\"key_as_string\": \"2019-01-01T12:00:00.000Z\", \"key\": 3, \"matching_results\": 15, \"event_rate\": 9}]}]}"; - String getMetricsQueryNoResultsPath = "/v1/metrics/number_of_queries_with_no_search_results"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetMetricsQueryNoResultsOptions model - GetMetricsQueryNoResultsOptions getMetricsQueryNoResultsOptionsModel = - new GetMetricsQueryNoResultsOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - - // Invoke getMetricsQueryNoResults() with a valid options model and verify the result - Response response = - discoveryService.getMetricsQueryNoResults(getMetricsQueryNoResultsOptionsModel).execute(); - assertNotNull(response); - MetricResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getMetricsQueryNoResultsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("result_type"), "document"); - } - - // Test the getMetricsQueryNoResults operation with and without retries enabled - @Test - public void testGetMetricsQueryNoResultsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetMetricsQueryNoResultsWOptions(); - - discoveryService.disableRetries(); - testGetMetricsQueryNoResultsWOptions(); - } - - // Test the getMetricsEventRate operation with a valid options model parameter - @Test - public void testGetMetricsEventRateWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"aggregations\": [{\"interval\": \"interval\", \"event_type\": \"eventType\", \"results\": [{\"key_as_string\": \"2019-01-01T12:00:00.000Z\", \"key\": 3, \"matching_results\": 15, \"event_rate\": 9}]}]}"; - String getMetricsEventRatePath = "/v1/metrics/event_rate"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetMetricsEventRateOptions model - GetMetricsEventRateOptions getMetricsEventRateOptionsModel = - new GetMetricsEventRateOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - - // Invoke getMetricsEventRate() with a valid options model and verify the result - Response response = - discoveryService.getMetricsEventRate(getMetricsEventRateOptionsModel).execute(); - assertNotNull(response); - MetricResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getMetricsEventRatePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(query.get("result_type"), "document"); - } - - // Test the getMetricsEventRate operation with and without retries enabled - @Test - public void testGetMetricsEventRateWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetMetricsEventRateWOptions(); - - discoveryService.disableRetries(); - testGetMetricsEventRateWOptions(); - } - - // Test the getMetricsQueryTokenEvent operation with a valid options model parameter - @Test - public void testGetMetricsQueryTokenEventWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"aggregations\": [{\"event_type\": \"eventType\", \"results\": [{\"key\": \"key\", \"matching_results\": 15, \"event_rate\": 9}]}]}"; - String getMetricsQueryTokenEventPath = "/v1/metrics/top_query_tokens_with_event_rate"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetMetricsQueryTokenEventOptions model - GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptionsModel = - new GetMetricsQueryTokenEventOptions.Builder().count(Long.valueOf("10")).build(); - - // Invoke getMetricsQueryTokenEvent() with a valid options model and verify the result - Response response = - discoveryService.getMetricsQueryTokenEvent(getMetricsQueryTokenEventOptionsModel).execute(); - assertNotNull(response); - MetricTokenResponse responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getMetricsQueryTokenEventPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - assertEquals(Long.valueOf(query.get("count")), Long.valueOf("10")); - } - - // Test the getMetricsQueryTokenEvent operation with and without retries enabled - @Test - public void testGetMetricsQueryTokenEventWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetMetricsQueryTokenEventWOptions(); - - discoveryService.disableRetries(); - testGetMetricsQueryTokenEventWOptions(); - } - - // Test the listCredentials operation with a valid options model parameter - @Test - public void testListCredentialsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"credentials\": [{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}]}"; - String listCredentialsPath = "/v1/environments/testString/credentials"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListCredentialsOptions model - ListCredentialsOptions listCredentialsOptionsModel = - new ListCredentialsOptions.Builder().environmentId("testString").build(); - - // Invoke listCredentials() with a valid options model and verify the result - Response response = - discoveryService.listCredentials(listCredentialsOptionsModel).execute(); - assertNotNull(response); - CredentialsList responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listCredentialsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the listCredentials operation with and without retries enabled - @Test - public void testListCredentialsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListCredentialsWOptions(); - - discoveryService.disableRetries(); - testListCredentialsWOptions(); - } - - // Test the listCredentials operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListCredentialsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listCredentials(null).execute(); - } - - // Test the createCredentials operation with a valid options model parameter - @Test - public void testCreateCredentialsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}"; - String createCredentialsPath = "/v1/environments/testString/credentials"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the CredentialDetails model - CredentialDetails credentialDetailsModel = - new CredentialDetails.Builder() - .credentialType("oauth2") - .clientId("testString") - .enterpriseId("testString") - .url("testString") - .username("testString") - .organizationUrl("testString") - .siteCollectionPath("testString") - .clientSecret("testString") - .publicKeyId("testString") - .privateKey("testString") - .passphrase("testString") - .password("testString") - .gatewayId("testString") - .sourceVersion("online") - .webApplicationUrl("testString") - .domain("testString") - .endpoint("testString") - .accessKeyId("testString") - .secretAccessKey("testString") - .build(); - - // Construct an instance of the StatusDetails model - StatusDetails statusDetailsModel = - new StatusDetails.Builder().authenticated(true).errorMessage("testString").build(); - - // Construct an instance of the CreateCredentialsOptions model - CreateCredentialsOptions createCredentialsOptionsModel = - new CreateCredentialsOptions.Builder() - .environmentId("testString") - .sourceType("box") - .credentialDetails(credentialDetailsModel) - .status(statusDetailsModel) - .build(); - - // Invoke createCredentials() with a valid options model and verify the result - Response response = - discoveryService.createCredentials(createCredentialsOptionsModel).execute(); - assertNotNull(response); - Credentials responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createCredentialsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createCredentials operation with and without retries enabled - @Test - public void testCreateCredentialsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateCredentialsWOptions(); - - discoveryService.disableRetries(); - testCreateCredentialsWOptions(); - } - - // Test the createCredentials operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateCredentialsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createCredentials(null).execute(); - } - - // Test the getCredentials operation with a valid options model parameter - @Test - public void testGetCredentialsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}"; - String getCredentialsPath = "/v1/environments/testString/credentials/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetCredentialsOptions model - GetCredentialsOptions getCredentialsOptionsModel = - new GetCredentialsOptions.Builder() - .environmentId("testString") - .credentialId("testString") - .build(); - - // Invoke getCredentials() with a valid options model and verify the result - Response response = - discoveryService.getCredentials(getCredentialsOptionsModel).execute(); - assertNotNull(response); - Credentials responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getCredentialsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getCredentials operation with and without retries enabled - @Test - public void testGetCredentialsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetCredentialsWOptions(); - - discoveryService.disableRetries(); - testGetCredentialsWOptions(); - } - - // Test the getCredentials operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetCredentialsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getCredentials(null).execute(); - } - - // Test the updateCredentials operation with a valid options model parameter - @Test - public void testUpdateCredentialsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"credential_id\": \"credentialId\", \"source_type\": \"box\", \"credential_details\": {\"credential_type\": \"oauth2\", \"client_id\": \"clientId\", \"enterprise_id\": \"enterpriseId\", \"url\": \"url\", \"username\": \"username\", \"organization_url\": \"organizationUrl\", \"site_collection.path\": \"siteCollectionPath\", \"client_secret\": \"clientSecret\", \"public_key_id\": \"publicKeyId\", \"private_key\": \"privateKey\", \"passphrase\": \"passphrase\", \"password\": \"password\", \"gateway_id\": \"gatewayId\", \"source_version\": \"online\", \"web_application_url\": \"webApplicationUrl\", \"domain\": \"domain\", \"endpoint\": \"endpoint\", \"access_key_id\": \"accessKeyId\", \"secret_access_key\": \"secretAccessKey\"}, \"status\": {\"authenticated\": false, \"error_message\": \"errorMessage\"}}"; - String updateCredentialsPath = "/v1/environments/testString/credentials/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the CredentialDetails model - CredentialDetails credentialDetailsModel = - new CredentialDetails.Builder() - .credentialType("oauth2") - .clientId("testString") - .enterpriseId("testString") - .url("testString") - .username("testString") - .organizationUrl("testString") - .siteCollectionPath("testString") - .clientSecret("testString") - .publicKeyId("testString") - .privateKey("testString") - .passphrase("testString") - .password("testString") - .gatewayId("testString") - .sourceVersion("online") - .webApplicationUrl("testString") - .domain("testString") - .endpoint("testString") - .accessKeyId("testString") - .secretAccessKey("testString") - .build(); - - // Construct an instance of the StatusDetails model - StatusDetails statusDetailsModel = - new StatusDetails.Builder().authenticated(true).errorMessage("testString").build(); - - // Construct an instance of the UpdateCredentialsOptions model - UpdateCredentialsOptions updateCredentialsOptionsModel = - new UpdateCredentialsOptions.Builder() - .environmentId("testString") - .credentialId("testString") - .sourceType("box") - .credentialDetails(credentialDetailsModel) - .status(statusDetailsModel) - .build(); - - // Invoke updateCredentials() with a valid options model and verify the result - Response response = - discoveryService.updateCredentials(updateCredentialsOptionsModel).execute(); - assertNotNull(response); - Credentials responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "PUT"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, updateCredentialsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the updateCredentials operation with and without retries enabled - @Test - public void testUpdateCredentialsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testUpdateCredentialsWOptions(); - - discoveryService.disableRetries(); - testUpdateCredentialsWOptions(); - } - - // Test the updateCredentials operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateCredentialsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.updateCredentials(null).execute(); - } - - // Test the deleteCredentials operation with a valid options model parameter - @Test - public void testDeleteCredentialsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"credential_id\": \"credentialId\", \"status\": \"deleted\"}"; - String deleteCredentialsPath = "/v1/environments/testString/credentials/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteCredentialsOptions model - DeleteCredentialsOptions deleteCredentialsOptionsModel = - new DeleteCredentialsOptions.Builder() - .environmentId("testString") - .credentialId("testString") - .build(); - - // Invoke deleteCredentials() with a valid options model and verify the result - Response response = - discoveryService.deleteCredentials(deleteCredentialsOptionsModel).execute(); - assertNotNull(response); - DeleteCredentials responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteCredentialsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteCredentials operation with and without retries enabled - @Test - public void testDeleteCredentialsWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteCredentialsWOptions(); - - discoveryService.disableRetries(); - testDeleteCredentialsWOptions(); - } - - // Test the deleteCredentials operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteCredentialsNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteCredentials(null).execute(); - } - - // Test the listGateways operation with a valid options model parameter - @Test - public void testListGatewaysWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"gateways\": [{\"gateway_id\": \"gatewayId\", \"name\": \"name\", \"status\": \"connected\", \"token\": \"token\", \"token_id\": \"tokenId\"}]}"; - String listGatewaysPath = "/v1/environments/testString/gateways"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListGatewaysOptions model - ListGatewaysOptions listGatewaysOptionsModel = - new ListGatewaysOptions.Builder().environmentId("testString").build(); - - // Invoke listGateways() with a valid options model and verify the result - Response response = - discoveryService.listGateways(listGatewaysOptionsModel).execute(); - assertNotNull(response); - GatewayList responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listGatewaysPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the listGateways operation with and without retries enabled - @Test - public void testListGatewaysWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testListGatewaysWOptions(); - - discoveryService.disableRetries(); - testListGatewaysWOptions(); - } - - // Test the listGateways operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListGatewaysNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.listGateways(null).execute(); - } - - // Test the createGateway operation with a valid options model parameter - @Test - public void testCreateGatewayWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"gateway_id\": \"gatewayId\", \"name\": \"name\", \"status\": \"connected\", \"token\": \"token\", \"token_id\": \"tokenId\"}"; - String createGatewayPath = "/v1/environments/testString/gateways"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the CreateGatewayOptions model - CreateGatewayOptions createGatewayOptionsModel = - new CreateGatewayOptions.Builder().environmentId("testString").name("testString").build(); - - // Invoke createGateway() with a valid options model and verify the result - Response response = - discoveryService.createGateway(createGatewayOptionsModel).execute(); - assertNotNull(response); - Gateway responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createGatewayPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the createGateway operation with and without retries enabled - @Test - public void testCreateGatewayWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testCreateGatewayWOptions(); - - discoveryService.disableRetries(); - testCreateGatewayWOptions(); - } - - // Test the createGateway operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateGatewayNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.createGateway(null).execute(); - } - - // Test the getGateway operation with a valid options model parameter - @Test - public void testGetGatewayWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"gateway_id\": \"gatewayId\", \"name\": \"name\", \"status\": \"connected\", \"token\": \"token\", \"token_id\": \"tokenId\"}"; - String getGatewayPath = "/v1/environments/testString/gateways/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetGatewayOptions model - GetGatewayOptions getGatewayOptionsModel = - new GetGatewayOptions.Builder().environmentId("testString").gatewayId("testString").build(); - - // Invoke getGateway() with a valid options model and verify the result - Response response = discoveryService.getGateway(getGatewayOptionsModel).execute(); - assertNotNull(response); - Gateway responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getGatewayPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the getGateway operation with and without retries enabled - @Test - public void testGetGatewayWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testGetGatewayWOptions(); - - discoveryService.disableRetries(); - testGetGatewayWOptions(); - } - - // Test the getGateway operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetGatewayNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.getGateway(null).execute(); - } - - // Test the deleteGateway operation with a valid options model parameter - @Test - public void testDeleteGatewayWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"gateway_id\": \"gatewayId\", \"status\": \"status\"}"; - String deleteGatewayPath = "/v1/environments/testString/gateways/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteGatewayOptions model - DeleteGatewayOptions deleteGatewayOptionsModel = - new DeleteGatewayOptions.Builder() - .environmentId("testString") - .gatewayId("testString") - .build(); - - // Invoke deleteGateway() with a valid options model and verify the result - Response response = - discoveryService.deleteGateway(deleteGatewayOptionsModel).execute(); - assertNotNull(response); - GatewayDelete responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteGatewayPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "testString"); - } - - // Test the deleteGateway operation with and without retries enabled - @Test - public void testDeleteGatewayWRetries() throws Throwable { - discoveryService.enableRetries(4, 30); - testDeleteGatewayWOptions(); - - discoveryService.disableRetries(); - testDeleteGatewayWOptions(); - } - - // Test the deleteGateway operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteGatewayNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - discoveryService.deleteGateway(null).execute(); - } - - // Perform setup needed before each test method - @BeforeMethod - public void beforeEachTest() { - // Start the mock server. - try { - server = new MockWebServer(); - server.start(); - } catch (IOException err) { - fail("Failed to instantiate mock web server"); - } - - // Construct an instance of the service - constructClientService(); - } - - // Perform tear down after each test method - @AfterMethod - public void afterEachTest() throws IOException { - server.shutdown(); - discoveryService = null; - } - - // Constructs an instance of the service to be used by the tests - public void constructClientService() { - final String serviceName = "testService"; - // set mock values for global params - String version = "testString"; - - final Authenticator authenticator = new NoAuthAuthenticator(); - discoveryService = new Discovery(version, serviceName, authenticator); - String url = server.url("/").toString(); - discoveryService.setServiceUrl(url); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptionsTest.java deleted file mode 100644 index 5ffd89ac503..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AddTrainingDataOptionsTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the AddTrainingDataOptions model. */ -public class AddTrainingDataOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testAddTrainingDataOptions() throws Throwable { - TrainingExample trainingExampleModel = - new TrainingExample.Builder() - .documentId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - assertEquals(trainingExampleModel.documentId(), "testString"); - assertEquals(trainingExampleModel.crossReference(), "testString"); - assertEquals(trainingExampleModel.relevance(), Long.valueOf("26")); - - AddTrainingDataOptions addTrainingDataOptionsModel = - new AddTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .naturalLanguageQuery("testString") - .filter("testString") - .examples(java.util.Arrays.asList(trainingExampleModel)) - .build(); - assertEquals(addTrainingDataOptionsModel.environmentId(), "testString"); - assertEquals(addTrainingDataOptionsModel.collectionId(), "testString"); - assertEquals(addTrainingDataOptionsModel.naturalLanguageQuery(), "testString"); - assertEquals(addTrainingDataOptionsModel.filter(), "testString"); - assertEquals( - addTrainingDataOptionsModel.examples(), java.util.Arrays.asList(trainingExampleModel)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddTrainingDataOptionsError() throws Throwable { - new AddTrainingDataOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ConfigurationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ConfigurationTest.java deleted file mode 100644 index 2d424d54a39..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ConfigurationTest.java +++ /dev/null @@ -1,367 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Configuration model. */ -public class ConfigurationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testConfiguration() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - assertEquals(pdfHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - assertEquals(pdfSettingsModel.heading(), pdfHeadingDetectionModel); - - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - assertEquals(wordHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - assertEquals(wordHeadingDetectionModel.styles(), java.util.Arrays.asList(wordStyleModel)); - - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - assertEquals(wordSettingsModel.heading(), wordHeadingDetectionModel); - - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - assertEquals(xPathPatternsModel.xpaths(), java.util.Arrays.asList("testString")); - - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("span")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - assertEquals(htmlSettingsModel.excludeTagsCompletely(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagsKeepContent(), java.util.Arrays.asList("span")); - assertEquals(htmlSettingsModel.keepContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.excludeContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.keepTagAttributes(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagAttributes(), java.util.Arrays.asList("testString")); - - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(true) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("custom-field-1", "custom-field-2")) - .build(); - assertEquals(segmentSettingsModel.enabled(), Boolean.valueOf(true)); - assertEquals(segmentSettingsModel.selectorTags(), java.util.Arrays.asList("h1", "h2")); - assertEquals( - segmentSettingsModel.annotatedFields(), - java.util.Arrays.asList("custom-field-1", "custom-field-2")); - - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("move") - .sourceField("extracted_metadata.title") - .destinationField("metadata.title") - .build(); - assertEquals(normalizationOperationModel.operation(), "move"); - assertEquals(normalizationOperationModel.sourceField(), "extracted_metadata.title"); - assertEquals(normalizationOperationModel.destinationField(), "metadata.title"); - - Conversions conversionsModel = - new Conversions.Builder() - .pdf(pdfSettingsModel) - .word(wordSettingsModel) - .html(htmlSettingsModel) - .segment(segmentSettingsModel) - .jsonNormalizations(java.util.Arrays.asList(normalizationOperationModel)) - .imageTextRecognition(true) - .build(); - assertEquals(conversionsModel.pdf(), pdfSettingsModel); - assertEquals(conversionsModel.word(), wordSettingsModel); - assertEquals(conversionsModel.html(), htmlSettingsModel); - assertEquals(conversionsModel.segment(), segmentSettingsModel); - assertEquals( - conversionsModel.jsonNormalizations(), - java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(conversionsModel.imageTextRecognition(), Boolean.valueOf(true)); - - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(false) - .limit(Long.valueOf("50")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(false)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("50")); - - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(false) - .limit(Long.valueOf("50")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("WKS-model-id") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(false)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("50")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "WKS-model-id"); - - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("IBM", "Watson")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("IBM", "Watson")); - - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("IBM", "Watson")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("IBM", "Watson")); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("50")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("50")); - - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("WKS-model-id").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "WKS-model-id"); - - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("8")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("8")); - - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - assertEquals(nluEnrichmentFeaturesModel.keywords(), nluEnrichmentKeywordsModel); - assertEquals(nluEnrichmentFeaturesModel.entities(), nluEnrichmentEntitiesModel); - assertEquals(nluEnrichmentFeaturesModel.sentiment(), nluEnrichmentSentimentModel); - assertEquals(nluEnrichmentFeaturesModel.emotion(), nluEnrichmentEmotionModel); - assertEquals( - nluEnrichmentFeaturesModel.categories(), - java.util.Collections.singletonMap("anyKey", "anyValue")); - assertEquals(nluEnrichmentFeaturesModel.semanticRoles(), nluEnrichmentSemanticRolesModel); - assertEquals(nluEnrichmentFeaturesModel.relations(), nluEnrichmentRelationsModel); - assertEquals(nluEnrichmentFeaturesModel.concepts(), nluEnrichmentConceptsModel); - - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - assertEquals(enrichmentOptionsModel.features(), nluEnrichmentFeaturesModel); - assertEquals(enrichmentOptionsModel.language(), "ar"); - assertEquals(enrichmentOptionsModel.model(), "testString"); - - Enrichment enrichmentModel = - new Enrichment.Builder() - .description("testString") - .destinationField("enriched_title") - .sourceField("title") - .overwrite(false) - .enrichment("natural_language_understanding") - .ignoreDownstreamErrors(false) - .options(enrichmentOptionsModel) - .build(); - assertEquals(enrichmentModel.description(), "testString"); - assertEquals(enrichmentModel.destinationField(), "enriched_title"); - assertEquals(enrichmentModel.sourceField(), "title"); - assertEquals(enrichmentModel.overwrite(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.enrichment(), "natural_language_understanding"); - assertEquals(enrichmentModel.ignoreDownstreamErrors(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.options(), enrichmentOptionsModel); - - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("weekly") - .build(); - assertEquals(sourceScheduleModel.enabled(), Boolean.valueOf(true)); - assertEquals(sourceScheduleModel.timeZone(), "America/New_York"); - assertEquals(sourceScheduleModel.frequency(), "weekly"); - - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsFolderModel.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModel.folderId(), "testString"); - assertEquals(sourceOptionsFolderModel.limit(), Long.valueOf("26")); - - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsObjectModel.name(), "testString"); - assertEquals(sourceOptionsObjectModel.limit(), Long.valueOf("26")); - - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("/sites/TestSiteA") - .limit(Long.valueOf("10")) - .build(); - assertEquals(sourceOptionsSiteCollModel.siteCollectionPath(), "/sites/TestSiteA"); - assertEquals(sourceOptionsSiteCollModel.limit(), Long.valueOf("10")); - - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - assertEquals(sourceOptionsWebCrawlModel.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModel.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModel.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModel.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModel.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModel.overrideRobotsTxt(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.blacklist(), java.util.Arrays.asList("testString")); - - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsBucketsModel.name(), "testString"); - assertEquals(sourceOptionsBucketsModel.limit(), Long.valueOf("26")); - - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - assertEquals(sourceOptionsModel.folders(), java.util.Arrays.asList(sourceOptionsFolderModel)); - assertEquals(sourceOptionsModel.objects(), java.util.Arrays.asList(sourceOptionsObjectModel)); - assertEquals( - sourceOptionsModel.siteCollections(), java.util.Arrays.asList(sourceOptionsSiteCollModel)); - assertEquals(sourceOptionsModel.urls(), java.util.Arrays.asList(sourceOptionsWebCrawlModel)); - assertEquals(sourceOptionsModel.buckets(), java.util.Arrays.asList(sourceOptionsBucketsModel)); - assertEquals(sourceOptionsModel.crawlAllBuckets(), Boolean.valueOf(true)); - - Source sourceModel = - new Source.Builder() - .type("salesforce") - .credentialId("00ad0000-0000-11e8-ba89-0ed5f00f718b") - .schedule(sourceScheduleModel) - .options(sourceOptionsModel) - .build(); - assertEquals(sourceModel.type(), "salesforce"); - assertEquals(sourceModel.credentialId(), "00ad0000-0000-11e8-ba89-0ed5f00f718b"); - assertEquals(sourceModel.schedule(), sourceScheduleModel); - assertEquals(sourceModel.options(), sourceOptionsModel); - - Configuration configurationModel = - new Configuration.Builder() - .name("testString") - .description("testString") - .conversions(conversionsModel) - .enrichments(java.util.Arrays.asList(enrichmentModel)) - .normalizations(java.util.Arrays.asList(normalizationOperationModel)) - .source(sourceModel) - .build(); - assertEquals(configurationModel.name(), "testString"); - assertEquals(configurationModel.description(), "testString"); - assertEquals(configurationModel.conversions(), conversionsModel); - assertEquals(configurationModel.enrichments(), java.util.Arrays.asList(enrichmentModel)); - assertEquals( - configurationModel.normalizations(), java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(configurationModel.source(), sourceModel); - - String json = TestUtilities.serialize(configurationModel); - - Configuration configurationModelNew = TestUtilities.deserialize(json, Configuration.class); - assertTrue(configurationModelNew instanceof Configuration); - assertEquals(configurationModelNew.name(), "testString"); - assertEquals(configurationModelNew.description(), "testString"); - assertEquals(configurationModelNew.conversions().toString(), conversionsModel.toString()); - assertEquals(configurationModelNew.source().toString(), sourceModel.toString()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testConfigurationError() throws Throwable { - new Configuration.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ConversionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ConversionsTest.java deleted file mode 100644 index ff38dbd35ab..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ConversionsTest.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Conversions model. */ -public class ConversionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testConversions() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - assertEquals(pdfHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - assertEquals(pdfSettingsModel.heading(), pdfHeadingDetectionModel); - - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - assertEquals(wordHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - assertEquals(wordHeadingDetectionModel.styles(), java.util.Arrays.asList(wordStyleModel)); - - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - assertEquals(wordSettingsModel.heading(), wordHeadingDetectionModel); - - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - assertEquals(xPathPatternsModel.xpaths(), java.util.Arrays.asList("testString")); - - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("testString")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - assertEquals(htmlSettingsModel.excludeTagsCompletely(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagsKeepContent(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.keepContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.excludeContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.keepTagAttributes(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagAttributes(), java.util.Arrays.asList("testString")); - - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(false) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("testString")) - .build(); - assertEquals(segmentSettingsModel.enabled(), Boolean.valueOf(false)); - assertEquals(segmentSettingsModel.selectorTags(), java.util.Arrays.asList("h1", "h2")); - assertEquals(segmentSettingsModel.annotatedFields(), java.util.Arrays.asList("testString")); - - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("copy") - .sourceField("testString") - .destinationField("testString") - .build(); - assertEquals(normalizationOperationModel.operation(), "copy"); - assertEquals(normalizationOperationModel.sourceField(), "testString"); - assertEquals(normalizationOperationModel.destinationField(), "testString"); - - Conversions conversionsModel = - new Conversions.Builder() - .pdf(pdfSettingsModel) - .word(wordSettingsModel) - .html(htmlSettingsModel) - .segment(segmentSettingsModel) - .jsonNormalizations(java.util.Arrays.asList(normalizationOperationModel)) - .imageTextRecognition(true) - .build(); - assertEquals(conversionsModel.pdf(), pdfSettingsModel); - assertEquals(conversionsModel.word(), wordSettingsModel); - assertEquals(conversionsModel.html(), htmlSettingsModel); - assertEquals(conversionsModel.segment(), segmentSettingsModel); - assertEquals( - conversionsModel.jsonNormalizations(), - java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(conversionsModel.imageTextRecognition(), Boolean.valueOf(true)); - - String json = TestUtilities.serialize(conversionsModel); - - Conversions conversionsModelNew = TestUtilities.deserialize(json, Conversions.class); - assertTrue(conversionsModelNew instanceof Conversions); - assertEquals(conversionsModelNew.pdf().toString(), pdfSettingsModel.toString()); - assertEquals(conversionsModelNew.word().toString(), wordSettingsModel.toString()); - assertEquals(conversionsModelNew.html().toString(), htmlSettingsModel.toString()); - assertEquals(conversionsModelNew.segment().toString(), segmentSettingsModel.toString()); - assertEquals(conversionsModelNew.imageTextRecognition(), Boolean.valueOf(true)); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptionsTest.java deleted file mode 100644 index d5a6dc30a8b..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCollectionOptionsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateCollectionOptions model. */ -public class CreateCollectionOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateCollectionOptions() throws Throwable { - CreateCollectionOptions createCollectionOptionsModel = - new CreateCollectionOptions.Builder() - .environmentId("testString") - .name("testString") - .description("testString") - .configurationId("testString") - .language("en") - .build(); - assertEquals(createCollectionOptionsModel.environmentId(), "testString"); - assertEquals(createCollectionOptionsModel.name(), "testString"); - assertEquals(createCollectionOptionsModel.description(), "testString"); - assertEquals(createCollectionOptionsModel.configurationId(), "testString"); - assertEquals(createCollectionOptionsModel.language(), "en"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateCollectionOptionsError() throws Throwable { - new CreateCollectionOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptionsTest.java deleted file mode 100644 index 190e6fafd3f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateConfigurationOptionsTest.java +++ /dev/null @@ -1,360 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateConfigurationOptions model. */ -public class CreateConfigurationOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateConfigurationOptions() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - assertEquals(pdfHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - assertEquals(pdfSettingsModel.heading(), pdfHeadingDetectionModel); - - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - assertEquals(wordHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - assertEquals(wordHeadingDetectionModel.styles(), java.util.Arrays.asList(wordStyleModel)); - - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - assertEquals(wordSettingsModel.heading(), wordHeadingDetectionModel); - - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - assertEquals(xPathPatternsModel.xpaths(), java.util.Arrays.asList("testString")); - - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("testString")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - assertEquals(htmlSettingsModel.excludeTagsCompletely(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagsKeepContent(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.keepContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.excludeContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.keepTagAttributes(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagAttributes(), java.util.Arrays.asList("testString")); - - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(false) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("testString")) - .build(); - assertEquals(segmentSettingsModel.enabled(), Boolean.valueOf(false)); - assertEquals(segmentSettingsModel.selectorTags(), java.util.Arrays.asList("h1", "h2")); - assertEquals(segmentSettingsModel.annotatedFields(), java.util.Arrays.asList("testString")); - - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("copy") - .sourceField("testString") - .destinationField("testString") - .build(); - assertEquals(normalizationOperationModel.operation(), "copy"); - assertEquals(normalizationOperationModel.sourceField(), "testString"); - assertEquals(normalizationOperationModel.destinationField(), "testString"); - - Conversions conversionsModel = - new Conversions.Builder() - .pdf(pdfSettingsModel) - .word(wordSettingsModel) - .html(htmlSettingsModel) - .segment(segmentSettingsModel) - .jsonNormalizations(java.util.Arrays.asList(normalizationOperationModel)) - .imageTextRecognition(true) - .build(); - assertEquals(conversionsModel.pdf(), pdfSettingsModel); - assertEquals(conversionsModel.word(), wordSettingsModel); - assertEquals(conversionsModel.html(), htmlSettingsModel); - assertEquals(conversionsModel.segment(), segmentSettingsModel); - assertEquals( - conversionsModel.jsonNormalizations(), - java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(conversionsModel.imageTextRecognition(), Boolean.valueOf(true)); - - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("26")); - - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "testString"); - - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("26")); - - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "testString"); - - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("26")); - - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - assertEquals(nluEnrichmentFeaturesModel.keywords(), nluEnrichmentKeywordsModel); - assertEquals(nluEnrichmentFeaturesModel.entities(), nluEnrichmentEntitiesModel); - assertEquals(nluEnrichmentFeaturesModel.sentiment(), nluEnrichmentSentimentModel); - assertEquals(nluEnrichmentFeaturesModel.emotion(), nluEnrichmentEmotionModel); - assertEquals( - nluEnrichmentFeaturesModel.categories(), - java.util.Collections.singletonMap("anyKey", "anyValue")); - assertEquals(nluEnrichmentFeaturesModel.semanticRoles(), nluEnrichmentSemanticRolesModel); - assertEquals(nluEnrichmentFeaturesModel.relations(), nluEnrichmentRelationsModel); - assertEquals(nluEnrichmentFeaturesModel.concepts(), nluEnrichmentConceptsModel); - - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - assertEquals(enrichmentOptionsModel.features(), nluEnrichmentFeaturesModel); - assertEquals(enrichmentOptionsModel.language(), "ar"); - assertEquals(enrichmentOptionsModel.model(), "testString"); - - Enrichment enrichmentModel = - new Enrichment.Builder() - .description("testString") - .destinationField("testString") - .sourceField("testString") - .overwrite(false) - .enrichment("testString") - .ignoreDownstreamErrors(false) - .options(enrichmentOptionsModel) - .build(); - assertEquals(enrichmentModel.description(), "testString"); - assertEquals(enrichmentModel.destinationField(), "testString"); - assertEquals(enrichmentModel.sourceField(), "testString"); - assertEquals(enrichmentModel.overwrite(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.enrichment(), "testString"); - assertEquals(enrichmentModel.ignoreDownstreamErrors(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.options(), enrichmentOptionsModel); - - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("daily") - .build(); - assertEquals(sourceScheduleModel.enabled(), Boolean.valueOf(true)); - assertEquals(sourceScheduleModel.timeZone(), "America/New_York"); - assertEquals(sourceScheduleModel.frequency(), "daily"); - - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsFolderModel.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModel.folderId(), "testString"); - assertEquals(sourceOptionsFolderModel.limit(), Long.valueOf("26")); - - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsObjectModel.name(), "testString"); - assertEquals(sourceOptionsObjectModel.limit(), Long.valueOf("26")); - - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsSiteCollModel.siteCollectionPath(), "testString"); - assertEquals(sourceOptionsSiteCollModel.limit(), Long.valueOf("26")); - - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - assertEquals(sourceOptionsWebCrawlModel.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModel.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModel.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModel.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModel.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModel.overrideRobotsTxt(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.blacklist(), java.util.Arrays.asList("testString")); - - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsBucketsModel.name(), "testString"); - assertEquals(sourceOptionsBucketsModel.limit(), Long.valueOf("26")); - - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - assertEquals(sourceOptionsModel.folders(), java.util.Arrays.asList(sourceOptionsFolderModel)); - assertEquals(sourceOptionsModel.objects(), java.util.Arrays.asList(sourceOptionsObjectModel)); - assertEquals( - sourceOptionsModel.siteCollections(), java.util.Arrays.asList(sourceOptionsSiteCollModel)); - assertEquals(sourceOptionsModel.urls(), java.util.Arrays.asList(sourceOptionsWebCrawlModel)); - assertEquals(sourceOptionsModel.buckets(), java.util.Arrays.asList(sourceOptionsBucketsModel)); - assertEquals(sourceOptionsModel.crawlAllBuckets(), Boolean.valueOf(true)); - - Source sourceModel = - new Source.Builder() - .type("box") - .credentialId("testString") - .schedule(sourceScheduleModel) - .options(sourceOptionsModel) - .build(); - assertEquals(sourceModel.type(), "box"); - assertEquals(sourceModel.credentialId(), "testString"); - assertEquals(sourceModel.schedule(), sourceScheduleModel); - assertEquals(sourceModel.options(), sourceOptionsModel); - - CreateConfigurationOptions createConfigurationOptionsModel = - new CreateConfigurationOptions.Builder() - .environmentId("testString") - .name("testString") - .description("testString") - .conversions(conversionsModel) - .enrichments(java.util.Arrays.asList(enrichmentModel)) - .normalizations(java.util.Arrays.asList(normalizationOperationModel)) - .source(sourceModel) - .build(); - assertEquals(createConfigurationOptionsModel.environmentId(), "testString"); - assertEquals(createConfigurationOptionsModel.name(), "testString"); - assertEquals(createConfigurationOptionsModel.description(), "testString"); - assertEquals(createConfigurationOptionsModel.conversions(), conversionsModel); - assertEquals( - createConfigurationOptionsModel.enrichments(), java.util.Arrays.asList(enrichmentModel)); - assertEquals( - createConfigurationOptionsModel.normalizations(), - java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(createConfigurationOptionsModel.source(), sourceModel); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateConfigurationOptionsError() throws Throwable { - new CreateConfigurationOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptionsTest.java deleted file mode 100644 index d2a3d9ebe0f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateCredentialsOptionsTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateCredentialsOptions model. */ -public class CreateCredentialsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateCredentialsOptions() throws Throwable { - CredentialDetails credentialDetailsModel = - new CredentialDetails.Builder() - .credentialType("oauth2") - .clientId("testString") - .enterpriseId("testString") - .url("testString") - .username("testString") - .organizationUrl("testString") - .siteCollectionPath("testString") - .clientSecret("testString") - .publicKeyId("testString") - .privateKey("testString") - .passphrase("testString") - .password("testString") - .gatewayId("testString") - .sourceVersion("online") - .webApplicationUrl("testString") - .domain("testString") - .endpoint("testString") - .accessKeyId("testString") - .secretAccessKey("testString") - .build(); - assertEquals(credentialDetailsModel.credentialType(), "oauth2"); - assertEquals(credentialDetailsModel.clientId(), "testString"); - assertEquals(credentialDetailsModel.enterpriseId(), "testString"); - assertEquals(credentialDetailsModel.url(), "testString"); - assertEquals(credentialDetailsModel.username(), "testString"); - assertEquals(credentialDetailsModel.organizationUrl(), "testString"); - assertEquals(credentialDetailsModel.siteCollectionPath(), "testString"); - assertEquals(credentialDetailsModel.clientSecret(), "testString"); - assertEquals(credentialDetailsModel.publicKeyId(), "testString"); - assertEquals(credentialDetailsModel.privateKey(), "testString"); - assertEquals(credentialDetailsModel.passphrase(), "testString"); - assertEquals(credentialDetailsModel.password(), "testString"); - assertEquals(credentialDetailsModel.gatewayId(), "testString"); - assertEquals(credentialDetailsModel.sourceVersion(), "online"); - assertEquals(credentialDetailsModel.webApplicationUrl(), "testString"); - assertEquals(credentialDetailsModel.domain(), "testString"); - assertEquals(credentialDetailsModel.endpoint(), "testString"); - assertEquals(credentialDetailsModel.accessKeyId(), "testString"); - assertEquals(credentialDetailsModel.secretAccessKey(), "testString"); - - StatusDetails statusDetailsModel = - new StatusDetails.Builder().authenticated(true).errorMessage("testString").build(); - assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true)); - assertEquals(statusDetailsModel.errorMessage(), "testString"); - - CreateCredentialsOptions createCredentialsOptionsModel = - new CreateCredentialsOptions.Builder() - .environmentId("testString") - .sourceType("box") - .credentialDetails(credentialDetailsModel) - .status(statusDetailsModel) - .build(); - assertEquals(createCredentialsOptionsModel.environmentId(), "testString"); - assertEquals(createCredentialsOptionsModel.sourceType(), "box"); - assertEquals(createCredentialsOptionsModel.credentialDetails(), credentialDetailsModel); - assertEquals(createCredentialsOptionsModel.status(), statusDetailsModel); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateCredentialsOptionsError() throws Throwable { - new CreateCredentialsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEventOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEventOptionsTest.java deleted file mode 100644 index eecba4bb8ab..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEventOptionsTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateEventOptions model. */ -public class CreateEventOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateEventOptions() throws Throwable { - EventData eventDataModel = - new EventData.Builder() - .environmentId("testString") - .sessionToken("testString") - .clientTimestamp(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .displayRank(Long.valueOf("26")) - .collectionId("testString") - .documentId("testString") - .build(); - assertEquals(eventDataModel.environmentId(), "testString"); - assertEquals(eventDataModel.sessionToken(), "testString"); - assertEquals( - eventDataModel.clientTimestamp(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(eventDataModel.displayRank(), Long.valueOf("26")); - assertEquals(eventDataModel.collectionId(), "testString"); - assertEquals(eventDataModel.documentId(), "testString"); - - CreateEventOptions createEventOptionsModel = - new CreateEventOptions.Builder().type("click").data(eventDataModel).build(); - assertEquals(createEventOptionsModel.type(), "click"); - assertEquals(createEventOptionsModel.data(), eventDataModel); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateEventOptionsError() throws Throwable { - new CreateEventOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEventResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEventResponseTest.java deleted file mode 100644 index c71eb32399e..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateEventResponseTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateEventResponse model. */ -public class CreateEventResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateEventResponse() throws Throwable { - CreateEventResponse createEventResponseModel = new CreateEventResponse(); - assertNull(createEventResponseModel.getType()); - assertNull(createEventResponseModel.getData()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateExpansionsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateExpansionsOptionsTest.java deleted file mode 100644 index 41ed04b1301..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateExpansionsOptionsTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateExpansionsOptions model. */ -public class CreateExpansionsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateExpansionsOptions() throws Throwable { - Expansion expansionModel = - new Expansion.Builder() - .inputTerms(java.util.Arrays.asList("testString")) - .expandedTerms(java.util.Arrays.asList("testString")) - .build(); - assertEquals(expansionModel.inputTerms(), java.util.Arrays.asList("testString")); - assertEquals(expansionModel.expandedTerms(), java.util.Arrays.asList("testString")); - - CreateExpansionsOptions createExpansionsOptionsModel = - new CreateExpansionsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .expansions(java.util.Arrays.asList(expansionModel)) - .build(); - assertEquals(createExpansionsOptionsModel.environmentId(), "testString"); - assertEquals(createExpansionsOptionsModel.collectionId(), "testString"); - assertEquals( - createExpansionsOptionsModel.expansions(), java.util.Arrays.asList(expansionModel)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateExpansionsOptionsError() throws Throwable { - new CreateExpansionsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateGatewayOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateGatewayOptionsTest.java deleted file mode 100644 index 9f237623fa3..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateGatewayOptionsTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateGatewayOptions model. */ -public class CreateGatewayOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateGatewayOptions() throws Throwable { - CreateGatewayOptions createGatewayOptionsModel = - new CreateGatewayOptions.Builder().environmentId("testString").name("testString").build(); - assertEquals(createGatewayOptionsModel.environmentId(), "testString"); - assertEquals(createGatewayOptionsModel.name(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateGatewayOptionsError() throws Throwable { - new CreateGatewayOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateTokenizationDictionaryOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateTokenizationDictionaryOptionsTest.java deleted file mode 100644 index 18544e05fca..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateTokenizationDictionaryOptionsTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateTokenizationDictionaryOptions model. */ -public class CreateTokenizationDictionaryOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateTokenizationDictionaryOptions() throws Throwable { - TokenDictRule tokenDictRuleModel = - new TokenDictRule.Builder() - .text("testString") - .tokens(java.util.Arrays.asList("testString")) - .readings(java.util.Arrays.asList("testString")) - .partOfSpeech("testString") - .build(); - assertEquals(tokenDictRuleModel.text(), "testString"); - assertEquals(tokenDictRuleModel.tokens(), java.util.Arrays.asList("testString")); - assertEquals(tokenDictRuleModel.readings(), java.util.Arrays.asList("testString")); - assertEquals(tokenDictRuleModel.partOfSpeech(), "testString"); - - CreateTokenizationDictionaryOptions createTokenizationDictionaryOptionsModel = - new CreateTokenizationDictionaryOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .tokenizationRules(java.util.Arrays.asList(tokenDictRuleModel)) - .build(); - assertEquals(createTokenizationDictionaryOptionsModel.environmentId(), "testString"); - assertEquals(createTokenizationDictionaryOptionsModel.collectionId(), "testString"); - assertEquals( - createTokenizationDictionaryOptionsModel.tokenizationRules(), - java.util.Arrays.asList(tokenDictRuleModel)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateTokenizationDictionaryOptionsError() throws Throwable { - new CreateTokenizationDictionaryOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateTrainingExampleOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateTrainingExampleOptionsTest.java deleted file mode 100644 index e9083adcafd..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CreateTrainingExampleOptionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CreateTrainingExampleOptions model. */ -public class CreateTrainingExampleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateTrainingExampleOptions() throws Throwable { - CreateTrainingExampleOptions createTrainingExampleOptionsModel = - new CreateTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .documentId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - assertEquals(createTrainingExampleOptionsModel.environmentId(), "testString"); - assertEquals(createTrainingExampleOptionsModel.collectionId(), "testString"); - assertEquals(createTrainingExampleOptionsModel.queryId(), "testString"); - assertEquals(createTrainingExampleOptionsModel.documentId(), "testString"); - assertEquals(createTrainingExampleOptionsModel.crossReference(), "testString"); - assertEquals(createTrainingExampleOptionsModel.relevance(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateTrainingExampleOptionsError() throws Throwable { - new CreateTrainingExampleOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialDetailsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialDetailsTest.java deleted file mode 100644 index 22fc188c139..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialDetailsTest.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the CredentialDetails model. */ -public class CredentialDetailsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCredentialDetails() throws Throwable { - CredentialDetails credentialDetailsModel = - new CredentialDetails.Builder() - .credentialType("oauth2") - .clientId("testString") - .enterpriseId("testString") - .url("testString") - .username("testString") - .organizationUrl("testString") - .siteCollectionPath("testString") - .clientSecret("testString") - .publicKeyId("testString") - .privateKey("testString") - .passphrase("testString") - .password("testString") - .gatewayId("testString") - .sourceVersion("online") - .webApplicationUrl("testString") - .domain("testString") - .endpoint("testString") - .accessKeyId("testString") - .secretAccessKey("testString") - .build(); - assertEquals(credentialDetailsModel.credentialType(), "oauth2"); - assertEquals(credentialDetailsModel.clientId(), "testString"); - assertEquals(credentialDetailsModel.enterpriseId(), "testString"); - assertEquals(credentialDetailsModel.url(), "testString"); - assertEquals(credentialDetailsModel.username(), "testString"); - assertEquals(credentialDetailsModel.organizationUrl(), "testString"); - assertEquals(credentialDetailsModel.siteCollectionPath(), "testString"); - assertEquals(credentialDetailsModel.clientSecret(), "testString"); - assertEquals(credentialDetailsModel.publicKeyId(), "testString"); - assertEquals(credentialDetailsModel.privateKey(), "testString"); - assertEquals(credentialDetailsModel.passphrase(), "testString"); - assertEquals(credentialDetailsModel.password(), "testString"); - assertEquals(credentialDetailsModel.gatewayId(), "testString"); - assertEquals(credentialDetailsModel.sourceVersion(), "online"); - assertEquals(credentialDetailsModel.webApplicationUrl(), "testString"); - assertEquals(credentialDetailsModel.domain(), "testString"); - assertEquals(credentialDetailsModel.endpoint(), "testString"); - assertEquals(credentialDetailsModel.accessKeyId(), "testString"); - assertEquals(credentialDetailsModel.secretAccessKey(), "testString"); - - String json = TestUtilities.serialize(credentialDetailsModel); - - CredentialDetails credentialDetailsModelNew = - TestUtilities.deserialize(json, CredentialDetails.class); - assertTrue(credentialDetailsModelNew instanceof CredentialDetails); - assertEquals(credentialDetailsModelNew.credentialType(), "oauth2"); - assertEquals(credentialDetailsModelNew.clientId(), "testString"); - assertEquals(credentialDetailsModelNew.enterpriseId(), "testString"); - assertEquals(credentialDetailsModelNew.url(), "testString"); - assertEquals(credentialDetailsModelNew.username(), "testString"); - assertEquals(credentialDetailsModelNew.organizationUrl(), "testString"); - assertEquals(credentialDetailsModelNew.siteCollectionPath(), "testString"); - assertEquals(credentialDetailsModelNew.clientSecret(), "testString"); - assertEquals(credentialDetailsModelNew.publicKeyId(), "testString"); - assertEquals(credentialDetailsModelNew.privateKey(), "testString"); - assertEquals(credentialDetailsModelNew.passphrase(), "testString"); - assertEquals(credentialDetailsModelNew.password(), "testString"); - assertEquals(credentialDetailsModelNew.gatewayId(), "testString"); - assertEquals(credentialDetailsModelNew.sourceVersion(), "online"); - assertEquals(credentialDetailsModelNew.webApplicationUrl(), "testString"); - assertEquals(credentialDetailsModelNew.domain(), "testString"); - assertEquals(credentialDetailsModelNew.endpoint(), "testString"); - assertEquals(credentialDetailsModelNew.accessKeyId(), "testString"); - assertEquals(credentialDetailsModelNew.secretAccessKey(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsTest.java deleted file mode 100644 index bfe9f7fb603..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Credentials model. */ -public class CredentialsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCredentials() throws Throwable { - CredentialDetails credentialDetailsModel = - new CredentialDetails.Builder() - .credentialType("username_password") - .clientId("testString") - .enterpriseId("testString") - .url("login.salesforce.com") - .username("user@email.address") - .organizationUrl("testString") - .siteCollectionPath("testString") - .clientSecret("testString") - .publicKeyId("testString") - .privateKey("testString") - .passphrase("testString") - .password("testString") - .gatewayId("testString") - .sourceVersion("online") - .webApplicationUrl("testString") - .domain("testString") - .endpoint("testString") - .accessKeyId("testString") - .secretAccessKey("testString") - .build(); - assertEquals(credentialDetailsModel.credentialType(), "username_password"); - assertEquals(credentialDetailsModel.clientId(), "testString"); - assertEquals(credentialDetailsModel.enterpriseId(), "testString"); - assertEquals(credentialDetailsModel.url(), "login.salesforce.com"); - assertEquals(credentialDetailsModel.username(), "user@email.address"); - assertEquals(credentialDetailsModel.organizationUrl(), "testString"); - assertEquals(credentialDetailsModel.siteCollectionPath(), "testString"); - assertEquals(credentialDetailsModel.clientSecret(), "testString"); - assertEquals(credentialDetailsModel.publicKeyId(), "testString"); - assertEquals(credentialDetailsModel.privateKey(), "testString"); - assertEquals(credentialDetailsModel.passphrase(), "testString"); - assertEquals(credentialDetailsModel.password(), "testString"); - assertEquals(credentialDetailsModel.gatewayId(), "testString"); - assertEquals(credentialDetailsModel.sourceVersion(), "online"); - assertEquals(credentialDetailsModel.webApplicationUrl(), "testString"); - assertEquals(credentialDetailsModel.domain(), "testString"); - assertEquals(credentialDetailsModel.endpoint(), "testString"); - assertEquals(credentialDetailsModel.accessKeyId(), "testString"); - assertEquals(credentialDetailsModel.secretAccessKey(), "testString"); - - StatusDetails statusDetailsModel = - new StatusDetails.Builder().authenticated(true).errorMessage("testString").build(); - assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true)); - assertEquals(statusDetailsModel.errorMessage(), "testString"); - - Credentials credentialsModel = - new Credentials.Builder() - .sourceType("box") - .credentialDetails(credentialDetailsModel) - .status(statusDetailsModel) - .build(); - assertEquals(credentialsModel.sourceType(), "box"); - assertEquals(credentialsModel.credentialDetails(), credentialDetailsModel); - assertEquals(credentialsModel.status(), statusDetailsModel); - - String json = TestUtilities.serialize(credentialsModel); - - Credentials credentialsModelNew = TestUtilities.deserialize(json, Credentials.class); - assertTrue(credentialsModelNew instanceof Credentials); - assertEquals(credentialsModelNew.sourceType(), "box"); - assertEquals( - credentialsModelNew.credentialDetails().toString(), credentialDetailsModel.toString()); - assertEquals(credentialsModelNew.status().toString(), statusDetailsModel.toString()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationOptionsTest.java deleted file mode 100644 index 0b1b1d146b6..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteConfigurationOptions model. */ -public class DeleteConfigurationOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteConfigurationOptions() throws Throwable { - DeleteConfigurationOptions deleteConfigurationOptionsModel = - new DeleteConfigurationOptions.Builder() - .environmentId("testString") - .configurationId("testString") - .build(); - assertEquals(deleteConfigurationOptionsModel.environmentId(), "testString"); - assertEquals(deleteConfigurationOptionsModel.configurationId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteConfigurationOptionsError() throws Throwable { - new DeleteConfigurationOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationResponseTest.java deleted file mode 100644 index b714bca5b45..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteConfigurationResponseTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteConfigurationResponse model. */ -public class DeleteConfigurationResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteConfigurationResponse() throws Throwable { - DeleteConfigurationResponse deleteConfigurationResponseModel = - new DeleteConfigurationResponse(); - assertNull(deleteConfigurationResponseModel.getConfigurationId()); - assertNull(deleteConfigurationResponseModel.getStatus()); - assertNull(deleteConfigurationResponseModel.getNotices()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsOptionsTest.java deleted file mode 100644 index 3b3a6d1c89f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteCredentialsOptions model. */ -public class DeleteCredentialsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteCredentialsOptions() throws Throwable { - DeleteCredentialsOptions deleteCredentialsOptionsModel = - new DeleteCredentialsOptions.Builder() - .environmentId("testString") - .credentialId("testString") - .build(); - assertEquals(deleteCredentialsOptionsModel.environmentId(), "testString"); - assertEquals(deleteCredentialsOptionsModel.credentialId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteCredentialsOptionsError() throws Throwable { - new DeleteCredentialsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsTest.java deleted file mode 100644 index 3a8742589be..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCredentialsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteCredentials model. */ -public class DeleteCredentialsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteCredentials() throws Throwable { - DeleteCredentials deleteCredentialsModel = new DeleteCredentials(); - assertNull(deleteCredentialsModel.getCredentialId()); - assertNull(deleteCredentialsModel.getStatus()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteDocumentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteDocumentOptionsTest.java deleted file mode 100644 index 2e4b5e02208..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteDocumentOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteDocumentOptions model. */ -public class DeleteDocumentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteDocumentOptions() throws Throwable { - DeleteDocumentOptions deleteDocumentOptionsModel = - new DeleteDocumentOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .documentId("testString") - .build(); - assertEquals(deleteDocumentOptionsModel.environmentId(), "testString"); - assertEquals(deleteDocumentOptionsModel.collectionId(), "testString"); - assertEquals(deleteDocumentOptionsModel.documentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteDocumentOptionsError() throws Throwable { - new DeleteDocumentOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteDocumentResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteDocumentResponseTest.java deleted file mode 100644 index 0845324279c..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteDocumentResponseTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteDocumentResponse model. */ -public class DeleteDocumentResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteDocumentResponse() throws Throwable { - DeleteDocumentResponse deleteDocumentResponseModel = new DeleteDocumentResponse(); - assertNull(deleteDocumentResponseModel.getDocumentId()); - assertNull(deleteDocumentResponseModel.getStatus()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentOptionsTest.java deleted file mode 100644 index eb8c5784d9f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteEnvironmentOptions model. */ -public class DeleteEnvironmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteEnvironmentOptions() throws Throwable { - DeleteEnvironmentOptions deleteEnvironmentOptionsModel = - new DeleteEnvironmentOptions.Builder().environmentId("testString").build(); - assertEquals(deleteEnvironmentOptionsModel.environmentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteEnvironmentOptionsError() throws Throwable { - new DeleteEnvironmentOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentResponseTest.java deleted file mode 100644 index 05f7324d4b4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteEnvironmentResponseTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteEnvironmentResponse model. */ -public class DeleteEnvironmentResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteEnvironmentResponse() throws Throwable { - DeleteEnvironmentResponse deleteEnvironmentResponseModel = new DeleteEnvironmentResponse(); - assertNull(deleteEnvironmentResponseModel.getEnvironmentId()); - assertNull(deleteEnvironmentResponseModel.getStatus()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteExpansionsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteExpansionsOptionsTest.java deleted file mode 100644 index db2475920ed..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteExpansionsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteExpansionsOptions model. */ -public class DeleteExpansionsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteExpansionsOptions() throws Throwable { - DeleteExpansionsOptions deleteExpansionsOptionsModel = - new DeleteExpansionsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(deleteExpansionsOptionsModel.environmentId(), "testString"); - assertEquals(deleteExpansionsOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteExpansionsOptionsError() throws Throwable { - new DeleteExpansionsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteGatewayOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteGatewayOptionsTest.java deleted file mode 100644 index dc9bba850d4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteGatewayOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteGatewayOptions model. */ -public class DeleteGatewayOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteGatewayOptions() throws Throwable { - DeleteGatewayOptions deleteGatewayOptionsModel = - new DeleteGatewayOptions.Builder() - .environmentId("testString") - .gatewayId("testString") - .build(); - assertEquals(deleteGatewayOptionsModel.environmentId(), "testString"); - assertEquals(deleteGatewayOptionsModel.gatewayId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteGatewayOptionsError() throws Throwable { - new DeleteGatewayOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteStopwordListOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteStopwordListOptionsTest.java deleted file mode 100644 index aa5cfce9608..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteStopwordListOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteStopwordListOptions model. */ -public class DeleteStopwordListOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteStopwordListOptions() throws Throwable { - DeleteStopwordListOptions deleteStopwordListOptionsModel = - new DeleteStopwordListOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(deleteStopwordListOptionsModel.environmentId(), "testString"); - assertEquals(deleteStopwordListOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteStopwordListOptionsError() throws Throwable { - new DeleteStopwordListOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTokenizationDictionaryOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTokenizationDictionaryOptionsTest.java deleted file mode 100644 index fdead2c11fc..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTokenizationDictionaryOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteTokenizationDictionaryOptions model. */ -public class DeleteTokenizationDictionaryOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteTokenizationDictionaryOptions() throws Throwable { - DeleteTokenizationDictionaryOptions deleteTokenizationDictionaryOptionsModel = - new DeleteTokenizationDictionaryOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(deleteTokenizationDictionaryOptionsModel.environmentId(), "testString"); - assertEquals(deleteTokenizationDictionaryOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteTokenizationDictionaryOptionsError() throws Throwable { - new DeleteTokenizationDictionaryOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTrainingExampleOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTrainingExampleOptionsTest.java deleted file mode 100644 index a9221301a57..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteTrainingExampleOptionsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteTrainingExampleOptions model. */ -public class DeleteTrainingExampleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteTrainingExampleOptions() throws Throwable { - DeleteTrainingExampleOptions deleteTrainingExampleOptionsModel = - new DeleteTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .exampleId("testString") - .build(); - assertEquals(deleteTrainingExampleOptionsModel.environmentId(), "testString"); - assertEquals(deleteTrainingExampleOptionsModel.collectionId(), "testString"); - assertEquals(deleteTrainingExampleOptionsModel.queryId(), "testString"); - assertEquals(deleteTrainingExampleOptionsModel.exampleId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteTrainingExampleOptionsError() throws Throwable { - new DeleteTrainingExampleOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptionsTest.java deleted file mode 100644 index 491fa5f484e..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteUserDataOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteUserDataOptions model. */ -public class DeleteUserDataOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteUserDataOptions() throws Throwable { - DeleteUserDataOptions deleteUserDataOptionsModel = - new DeleteUserDataOptions.Builder().customerId("testString").build(); - assertEquals(deleteUserDataOptionsModel.customerId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteUserDataOptionsError() throws Throwable { - new DeleteUserDataOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DiskUsageTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DiskUsageTest.java deleted file mode 100644 index 8e4a65aa2c3..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DiskUsageTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DiskUsage model. */ -public class DiskUsageTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDiskUsage() throws Throwable { - DiskUsage diskUsageModel = new DiskUsage(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentAcceptedTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentAcceptedTest.java deleted file mode 100644 index bb9399e28f5..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentAcceptedTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DocumentAccepted model. */ -public class DocumentAcceptedTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDocumentAccepted() throws Throwable { - DocumentAccepted documentAcceptedModel = new DocumentAccepted(); - assertNull(documentAcceptedModel.getDocumentId()); - assertNull(documentAcceptedModel.getStatus()); - assertNull(documentAcceptedModel.getNotices()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentStatusTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentStatusTest.java deleted file mode 100644 index 21009a2fe15..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DocumentStatusTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DocumentStatus model. */ -public class DocumentStatusTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDocumentStatus() throws Throwable { - DocumentStatus documentStatusModel = new DocumentStatus(); - assertNull(documentStatusModel.getFilename()); - assertNull(documentStatusModel.getFileType()); - assertNull(documentStatusModel.getSha1()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnrichmentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnrichmentOptionsTest.java deleted file mode 100644 index e1047e1e05d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnrichmentOptionsTest.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the EnrichmentOptions model. */ -public class EnrichmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testEnrichmentOptions() throws Throwable { - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("26")); - - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "testString"); - - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("26")); - - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "testString"); - - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("26")); - - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - assertEquals(nluEnrichmentFeaturesModel.keywords(), nluEnrichmentKeywordsModel); - assertEquals(nluEnrichmentFeaturesModel.entities(), nluEnrichmentEntitiesModel); - assertEquals(nluEnrichmentFeaturesModel.sentiment(), nluEnrichmentSentimentModel); - assertEquals(nluEnrichmentFeaturesModel.emotion(), nluEnrichmentEmotionModel); - assertEquals( - nluEnrichmentFeaturesModel.categories(), - java.util.Collections.singletonMap("anyKey", "anyValue")); - assertEquals(nluEnrichmentFeaturesModel.semanticRoles(), nluEnrichmentSemanticRolesModel); - assertEquals(nluEnrichmentFeaturesModel.relations(), nluEnrichmentRelationsModel); - assertEquals(nluEnrichmentFeaturesModel.concepts(), nluEnrichmentConceptsModel); - - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - assertEquals(enrichmentOptionsModel.features(), nluEnrichmentFeaturesModel); - assertEquals(enrichmentOptionsModel.language(), "ar"); - assertEquals(enrichmentOptionsModel.model(), "testString"); - - String json = TestUtilities.serialize(enrichmentOptionsModel); - - EnrichmentOptions enrichmentOptionsModelNew = - TestUtilities.deserialize(json, EnrichmentOptions.class); - assertTrue(enrichmentOptionsModelNew instanceof EnrichmentOptions); - assertEquals( - enrichmentOptionsModelNew.features().toString(), nluEnrichmentFeaturesModel.toString()); - assertEquals(enrichmentOptionsModelNew.language(), "ar"); - assertEquals(enrichmentOptionsModelNew.model(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnrichmentTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnrichmentTest.java deleted file mode 100644 index 7ade966ef93..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnrichmentTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Enrichment model. */ -public class EnrichmentTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testEnrichment() throws Throwable { - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("26")); - - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "testString"); - - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("26")); - - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "testString"); - - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("26")); - - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - assertEquals(nluEnrichmentFeaturesModel.keywords(), nluEnrichmentKeywordsModel); - assertEquals(nluEnrichmentFeaturesModel.entities(), nluEnrichmentEntitiesModel); - assertEquals(nluEnrichmentFeaturesModel.sentiment(), nluEnrichmentSentimentModel); - assertEquals(nluEnrichmentFeaturesModel.emotion(), nluEnrichmentEmotionModel); - assertEquals( - nluEnrichmentFeaturesModel.categories(), - java.util.Collections.singletonMap("anyKey", "anyValue")); - assertEquals(nluEnrichmentFeaturesModel.semanticRoles(), nluEnrichmentSemanticRolesModel); - assertEquals(nluEnrichmentFeaturesModel.relations(), nluEnrichmentRelationsModel); - assertEquals(nluEnrichmentFeaturesModel.concepts(), nluEnrichmentConceptsModel); - - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - assertEquals(enrichmentOptionsModel.features(), nluEnrichmentFeaturesModel); - assertEquals(enrichmentOptionsModel.language(), "ar"); - assertEquals(enrichmentOptionsModel.model(), "testString"); - - Enrichment enrichmentModel = - new Enrichment.Builder() - .description("testString") - .destinationField("testString") - .sourceField("testString") - .overwrite(false) - .enrichment("testString") - .ignoreDownstreamErrors(false) - .options(enrichmentOptionsModel) - .build(); - assertEquals(enrichmentModel.description(), "testString"); - assertEquals(enrichmentModel.destinationField(), "testString"); - assertEquals(enrichmentModel.sourceField(), "testString"); - assertEquals(enrichmentModel.overwrite(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.enrichment(), "testString"); - assertEquals(enrichmentModel.ignoreDownstreamErrors(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.options(), enrichmentOptionsModel); - - String json = TestUtilities.serialize(enrichmentModel); - - Enrichment enrichmentModelNew = TestUtilities.deserialize(json, Enrichment.class); - assertTrue(enrichmentModelNew instanceof Enrichment); - assertEquals(enrichmentModelNew.description(), "testString"); - assertEquals(enrichmentModelNew.destinationField(), "testString"); - assertEquals(enrichmentModelNew.sourceField(), "testString"); - assertEquals(enrichmentModelNew.overwrite(), Boolean.valueOf(false)); - assertEquals(enrichmentModelNew.enrichment(), "testString"); - assertEquals(enrichmentModelNew.ignoreDownstreamErrors(), Boolean.valueOf(false)); - assertEquals(enrichmentModelNew.options().toString(), enrichmentOptionsModel.toString()); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testEnrichmentError() throws Throwable { - new Enrichment.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnvironmentDocumentsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnvironmentDocumentsTest.java deleted file mode 100644 index e7222fc407d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnvironmentDocumentsTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the EnvironmentDocuments model. */ -public class EnvironmentDocumentsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testEnvironmentDocuments() throws Throwable { - EnvironmentDocuments environmentDocumentsModel = new EnvironmentDocuments(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnvironmentTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnvironmentTest.java deleted file mode 100644 index fee64f22d0b..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EnvironmentTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Environment model. */ -public class EnvironmentTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testEnvironment() throws Throwable { - Environment environmentModel = new Environment(); - assertNull(environmentModel.getName()); - assertNull(environmentModel.getDescription()); - assertNull(environmentModel.getSize()); - assertNull(environmentModel.getRequestedSize()); - assertNull(environmentModel.getIndexCapacity()); - assertNull(environmentModel.getSearchStatus()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EventDataTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EventDataTest.java deleted file mode 100644 index 41ad4c76fa4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/EventDataTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the EventData model. */ -public class EventDataTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testEventData() throws Throwable { - EventData eventDataModel = - new EventData.Builder() - .environmentId("testString") - .sessionToken("testString") - .clientTimestamp(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .displayRank(Long.valueOf("26")) - .collectionId("testString") - .documentId("testString") - .build(); - assertEquals(eventDataModel.environmentId(), "testString"); - assertEquals(eventDataModel.sessionToken(), "testString"); - assertEquals( - eventDataModel.clientTimestamp(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(eventDataModel.displayRank(), Long.valueOf("26")); - assertEquals(eventDataModel.collectionId(), "testString"); - assertEquals(eventDataModel.documentId(), "testString"); - - String json = TestUtilities.serialize(eventDataModel); - - EventData eventDataModelNew = TestUtilities.deserialize(json, EventData.class); - assertTrue(eventDataModelNew instanceof EventData); - assertEquals(eventDataModelNew.environmentId(), "testString"); - assertEquals(eventDataModelNew.sessionToken(), "testString"); - assertEquals( - eventDataModelNew.clientTimestamp(), DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(eventDataModelNew.displayRank(), Long.valueOf("26")); - assertEquals(eventDataModelNew.collectionId(), "testString"); - assertEquals(eventDataModelNew.documentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testEventDataError() throws Throwable { - new EventData.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ExpansionTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ExpansionTest.java deleted file mode 100644 index c958e477014..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ExpansionTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Expansion model. */ -public class ExpansionTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testExpansion() throws Throwable { - Expansion expansionModel = - new Expansion.Builder() - .inputTerms(java.util.Arrays.asList("testString")) - .expandedTerms(java.util.Arrays.asList("testString")) - .build(); - assertEquals(expansionModel.inputTerms(), java.util.Arrays.asList("testString")); - assertEquals(expansionModel.expandedTerms(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(expansionModel); - - Expansion expansionModelNew = TestUtilities.deserialize(json, Expansion.class); - assertTrue(expansionModelNew instanceof Expansion); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testExpansionError() throws Throwable { - new Expansion.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ExpansionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ExpansionsTest.java deleted file mode 100644 index 19b2fda37e7..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ExpansionsTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Expansions model. */ -public class ExpansionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testExpansions() throws Throwable { - Expansion expansionModel = - new Expansion.Builder() - .inputTerms(java.util.Arrays.asList("testString")) - .expandedTerms(java.util.Arrays.asList("testString")) - .build(); - assertEquals(expansionModel.inputTerms(), java.util.Arrays.asList("testString")); - assertEquals(expansionModel.expandedTerms(), java.util.Arrays.asList("testString")); - - Expansions expansionsModel = - new Expansions.Builder().expansions(java.util.Arrays.asList(expansionModel)).build(); - assertEquals(expansionsModel.expansions(), java.util.Arrays.asList(expansionModel)); - - String json = TestUtilities.serialize(expansionsModel); - - Expansions expansionsModelNew = TestUtilities.deserialize(json, Expansions.class); - assertTrue(expansionsModelNew instanceof Expansions); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testExpansionsError() throws Throwable { - new Expansions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FederatedQueryNoticesOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FederatedQueryNoticesOptionsTest.java deleted file mode 100644 index 96542fce441..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FederatedQueryNoticesOptionsTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the FederatedQueryNoticesOptions model. */ -public class FederatedQueryNoticesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testFederatedQueryNoticesOptions() throws Throwable { - FederatedQueryNoticesOptions federatedQueryNoticesOptionsModel = - new FederatedQueryNoticesOptions.Builder() - .environmentId("testString") - .collectionIds(java.util.Arrays.asList("testString")) - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn(java.util.Arrays.asList("testString")) - .offset(Long.valueOf("26")) - .sort(java.util.Arrays.asList("testString")) - .highlight(false) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds(java.util.Arrays.asList("testString")) - .similarFields(java.util.Arrays.asList("testString")) - .build(); - assertEquals(federatedQueryNoticesOptionsModel.environmentId(), "testString"); - assertEquals( - federatedQueryNoticesOptionsModel.collectionIds(), java.util.Arrays.asList("testString")); - assertEquals(federatedQueryNoticesOptionsModel.filter(), "testString"); - assertEquals(federatedQueryNoticesOptionsModel.query(), "testString"); - assertEquals(federatedQueryNoticesOptionsModel.naturalLanguageQuery(), "testString"); - assertEquals(federatedQueryNoticesOptionsModel.aggregation(), "testString"); - assertEquals(federatedQueryNoticesOptionsModel.count(), Long.valueOf("10")); - assertEquals( - federatedQueryNoticesOptionsModel.xReturn(), java.util.Arrays.asList("testString")); - assertEquals(federatedQueryNoticesOptionsModel.offset(), Long.valueOf("26")); - assertEquals(federatedQueryNoticesOptionsModel.sort(), java.util.Arrays.asList("testString")); - assertEquals(federatedQueryNoticesOptionsModel.highlight(), Boolean.valueOf(false)); - assertEquals(federatedQueryNoticesOptionsModel.deduplicateField(), "testString"); - assertEquals(federatedQueryNoticesOptionsModel.similar(), Boolean.valueOf(false)); - assertEquals( - federatedQueryNoticesOptionsModel.similarDocumentIds(), - java.util.Arrays.asList("testString")); - assertEquals( - federatedQueryNoticesOptionsModel.similarFields(), java.util.Arrays.asList("testString")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testFederatedQueryNoticesOptionsError() throws Throwable { - new FederatedQueryNoticesOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FederatedQueryOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FederatedQueryOptionsTest.java deleted file mode 100644 index f5f2d93ffae..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FederatedQueryOptionsTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the FederatedQueryOptions model. */ -public class FederatedQueryOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testFederatedQueryOptions() throws Throwable { - FederatedQueryOptions federatedQueryOptionsModel = - new FederatedQueryOptions.Builder() - .environmentId("testString") - .collectionIds("testString") - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .passages(true) - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn("testString") - .offset(Long.valueOf("26")) - .sort("testString") - .highlight(false) - .passagesFields("testString") - .passagesCount(Long.valueOf("10")) - .passagesCharacters(Long.valueOf("400")) - .deduplicate(false) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds("testString") - .similarFields("testString") - .bias("testString") - .xWatsonLoggingOptOut(false) - .build(); - assertEquals(federatedQueryOptionsModel.environmentId(), "testString"); - assertEquals(federatedQueryOptionsModel.collectionIds(), "testString"); - assertEquals(federatedQueryOptionsModel.filter(), "testString"); - assertEquals(federatedQueryOptionsModel.query(), "testString"); - assertEquals(federatedQueryOptionsModel.naturalLanguageQuery(), "testString"); - assertEquals(federatedQueryOptionsModel.passages(), Boolean.valueOf(true)); - assertEquals(federatedQueryOptionsModel.aggregation(), "testString"); - assertEquals(federatedQueryOptionsModel.count(), Long.valueOf("10")); - assertEquals(federatedQueryOptionsModel.xReturn(), "testString"); - assertEquals(federatedQueryOptionsModel.offset(), Long.valueOf("26")); - assertEquals(federatedQueryOptionsModel.sort(), "testString"); - assertEquals(federatedQueryOptionsModel.highlight(), Boolean.valueOf(false)); - assertEquals(federatedQueryOptionsModel.passagesFields(), "testString"); - assertEquals(federatedQueryOptionsModel.passagesCount(), Long.valueOf("10")); - assertEquals(federatedQueryOptionsModel.passagesCharacters(), Long.valueOf("400")); - assertEquals(federatedQueryOptionsModel.deduplicate(), Boolean.valueOf(false)); - assertEquals(federatedQueryOptionsModel.deduplicateField(), "testString"); - assertEquals(federatedQueryOptionsModel.similar(), Boolean.valueOf(false)); - assertEquals(federatedQueryOptionsModel.similarDocumentIds(), "testString"); - assertEquals(federatedQueryOptionsModel.similarFields(), "testString"); - assertEquals(federatedQueryOptionsModel.bias(), "testString"); - assertEquals(federatedQueryOptionsModel.xWatsonLoggingOptOut(), Boolean.valueOf(false)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testFederatedQueryOptionsError() throws Throwable { - new FederatedQueryOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FieldTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FieldTest.java deleted file mode 100644 index c0e96eb45c8..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FieldTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Field model. */ -public class FieldTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testField() throws Throwable { - Field fieldModel = new Field(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FontSettingTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FontSettingTest.java deleted file mode 100644 index 42a095938e1..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/FontSettingTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the FontSetting model. */ -public class FontSettingTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testFontSetting() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - String json = TestUtilities.serialize(fontSettingModel); - - FontSetting fontSettingModelNew = TestUtilities.deserialize(json, FontSetting.class); - assertTrue(fontSettingModelNew instanceof FontSetting); - assertEquals(fontSettingModelNew.level(), Long.valueOf("26")); - assertEquals(fontSettingModelNew.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModelNew.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModelNew.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModelNew.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModelNew.name(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayDeleteTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayDeleteTest.java deleted file mode 100644 index 4e2442edf25..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayDeleteTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GatewayDelete model. */ -public class GatewayDeleteTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGatewayDelete() throws Throwable { - GatewayDelete gatewayDeleteModel = new GatewayDelete(); - assertNull(gatewayDeleteModel.getGatewayId()); - assertNull(gatewayDeleteModel.getStatus()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayListTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayListTest.java deleted file mode 100644 index cceccd8dc43..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayListTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GatewayList model. */ -public class GatewayListTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGatewayList() throws Throwable { - GatewayList gatewayListModel = new GatewayList(); - assertNull(gatewayListModel.getGateways()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayTest.java deleted file mode 100644 index 4d35166ea79..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GatewayTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Gateway model. */ -public class GatewayTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGateway() throws Throwable { - Gateway gatewayModel = new Gateway(); - assertNull(gatewayModel.getGatewayId()); - assertNull(gatewayModel.getName()); - assertNull(gatewayModel.getStatus()); - assertNull(gatewayModel.getToken()); - assertNull(gatewayModel.getTokenId()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetAutocompletionOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetAutocompletionOptionsTest.java deleted file mode 100644 index efff2c0af07..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetAutocompletionOptionsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetAutocompletionOptions model. */ -public class GetAutocompletionOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetAutocompletionOptions() throws Throwable { - GetAutocompletionOptions getAutocompletionOptionsModel = - new GetAutocompletionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .prefix("testString") - .field("testString") - .count(Long.valueOf("5")) - .build(); - assertEquals(getAutocompletionOptionsModel.environmentId(), "testString"); - assertEquals(getAutocompletionOptionsModel.collectionId(), "testString"); - assertEquals(getAutocompletionOptionsModel.prefix(), "testString"); - assertEquals(getAutocompletionOptionsModel.field(), "testString"); - assertEquals(getAutocompletionOptionsModel.count(), Long.valueOf("5")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetAutocompletionOptionsError() throws Throwable { - new GetAutocompletionOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetCollectionOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetCollectionOptionsTest.java deleted file mode 100644 index 690a5ca70fb..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetCollectionOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetCollectionOptions model. */ -public class GetCollectionOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetCollectionOptions() throws Throwable { - GetCollectionOptions getCollectionOptionsModel = - new GetCollectionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(getCollectionOptionsModel.environmentId(), "testString"); - assertEquals(getCollectionOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetCollectionOptionsError() throws Throwable { - new GetCollectionOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetConfigurationOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetConfigurationOptionsTest.java deleted file mode 100644 index b9bc7c7af77..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetConfigurationOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetConfigurationOptions model. */ -public class GetConfigurationOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetConfigurationOptions() throws Throwable { - GetConfigurationOptions getConfigurationOptionsModel = - new GetConfigurationOptions.Builder() - .environmentId("testString") - .configurationId("testString") - .build(); - assertEquals(getConfigurationOptionsModel.environmentId(), "testString"); - assertEquals(getConfigurationOptionsModel.configurationId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetConfigurationOptionsError() throws Throwable { - new GetConfigurationOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetCredentialsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetCredentialsOptionsTest.java deleted file mode 100644 index 4c7a4cf31e3..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetCredentialsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetCredentialsOptions model. */ -public class GetCredentialsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetCredentialsOptions() throws Throwable { - GetCredentialsOptions getCredentialsOptionsModel = - new GetCredentialsOptions.Builder() - .environmentId("testString") - .credentialId("testString") - .build(); - assertEquals(getCredentialsOptionsModel.environmentId(), "testString"); - assertEquals(getCredentialsOptionsModel.credentialId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetCredentialsOptionsError() throws Throwable { - new GetCredentialsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetDocumentStatusOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetDocumentStatusOptionsTest.java deleted file mode 100644 index e8ada11a6f2..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetDocumentStatusOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetDocumentStatusOptions model. */ -public class GetDocumentStatusOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetDocumentStatusOptions() throws Throwable { - GetDocumentStatusOptions getDocumentStatusOptionsModel = - new GetDocumentStatusOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .documentId("testString") - .build(); - assertEquals(getDocumentStatusOptionsModel.environmentId(), "testString"); - assertEquals(getDocumentStatusOptionsModel.collectionId(), "testString"); - assertEquals(getDocumentStatusOptionsModel.documentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDocumentStatusOptionsError() throws Throwable { - new GetDocumentStatusOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetEnvironmentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetEnvironmentOptionsTest.java deleted file mode 100644 index 08fa7ca9d9b..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetEnvironmentOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetEnvironmentOptions model. */ -public class GetEnvironmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetEnvironmentOptions() throws Throwable { - GetEnvironmentOptions getEnvironmentOptionsModel = - new GetEnvironmentOptions.Builder().environmentId("testString").build(); - assertEquals(getEnvironmentOptionsModel.environmentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetEnvironmentOptionsError() throws Throwable { - new GetEnvironmentOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsEventRateOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsEventRateOptionsTest.java deleted file mode 100644 index 87317eb4806..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsEventRateOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetMetricsEventRateOptions model. */ -public class GetMetricsEventRateOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetMetricsEventRateOptions() throws Throwable { - GetMetricsEventRateOptions getMetricsEventRateOptionsModel = - new GetMetricsEventRateOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - assertEquals( - getMetricsEventRateOptionsModel.startTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals( - getMetricsEventRateOptionsModel.endTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(getMetricsEventRateOptionsModel.resultType(), "document"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryEventOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryEventOptionsTest.java deleted file mode 100644 index d1400c24c77..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryEventOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetMetricsQueryEventOptions model. */ -public class GetMetricsQueryEventOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetMetricsQueryEventOptions() throws Throwable { - GetMetricsQueryEventOptions getMetricsQueryEventOptionsModel = - new GetMetricsQueryEventOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - assertEquals( - getMetricsQueryEventOptionsModel.startTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals( - getMetricsQueryEventOptionsModel.endTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(getMetricsQueryEventOptionsModel.resultType(), "document"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryNoResultsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryNoResultsOptionsTest.java deleted file mode 100644 index 9de882c132d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryNoResultsOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetMetricsQueryNoResultsOptions model. */ -public class GetMetricsQueryNoResultsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetMetricsQueryNoResultsOptions() throws Throwable { - GetMetricsQueryNoResultsOptions getMetricsQueryNoResultsOptionsModel = - new GetMetricsQueryNoResultsOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - assertEquals( - getMetricsQueryNoResultsOptionsModel.startTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals( - getMetricsQueryNoResultsOptionsModel.endTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(getMetricsQueryNoResultsOptionsModel.resultType(), "document"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryOptionsTest.java deleted file mode 100644 index 586d5588320..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetMetricsQueryOptions model. */ -public class GetMetricsQueryOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetMetricsQueryOptions() throws Throwable { - GetMetricsQueryOptions getMetricsQueryOptionsModel = - new GetMetricsQueryOptions.Builder() - .startTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .endTime(DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")) - .resultType("document") - .build(); - assertEquals( - getMetricsQueryOptionsModel.startTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals( - getMetricsQueryOptionsModel.endTime(), - DateUtils.parseAsDateTime("2019-01-01T12:00:00.000Z")); - assertEquals(getMetricsQueryOptionsModel.resultType(), "document"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryTokenEventOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryTokenEventOptionsTest.java deleted file mode 100644 index a907da416e0..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetMetricsQueryTokenEventOptionsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetMetricsQueryTokenEventOptions model. */ -public class GetMetricsQueryTokenEventOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetMetricsQueryTokenEventOptions() throws Throwable { - GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptionsModel = - new GetMetricsQueryTokenEventOptions.Builder().count(Long.valueOf("10")).build(); - assertEquals(getMetricsQueryTokenEventOptionsModel.count(), Long.valueOf("10")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTokenizationDictionaryStatusOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTokenizationDictionaryStatusOptionsTest.java deleted file mode 100644 index 72ca1cff4a3..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTokenizationDictionaryStatusOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetTokenizationDictionaryStatusOptions model. */ -public class GetTokenizationDictionaryStatusOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetTokenizationDictionaryStatusOptions() throws Throwable { - GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptionsModel = - new GetTokenizationDictionaryStatusOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(getTokenizationDictionaryStatusOptionsModel.environmentId(), "testString"); - assertEquals(getTokenizationDictionaryStatusOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTokenizationDictionaryStatusOptionsError() throws Throwable { - new GetTokenizationDictionaryStatusOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTrainingDataOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTrainingDataOptionsTest.java deleted file mode 100644 index 21a4fa68a0d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTrainingDataOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetTrainingDataOptions model. */ -public class GetTrainingDataOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetTrainingDataOptions() throws Throwable { - GetTrainingDataOptions getTrainingDataOptionsModel = - new GetTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .build(); - assertEquals(getTrainingDataOptionsModel.environmentId(), "testString"); - assertEquals(getTrainingDataOptionsModel.collectionId(), "testString"); - assertEquals(getTrainingDataOptionsModel.queryId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTrainingDataOptionsError() throws Throwable { - new GetTrainingDataOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTrainingExampleOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTrainingExampleOptionsTest.java deleted file mode 100644 index 1b984d66cad..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetTrainingExampleOptionsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetTrainingExampleOptions model. */ -public class GetTrainingExampleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetTrainingExampleOptions() throws Throwable { - GetTrainingExampleOptions getTrainingExampleOptionsModel = - new GetTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .exampleId("testString") - .build(); - assertEquals(getTrainingExampleOptionsModel.environmentId(), "testString"); - assertEquals(getTrainingExampleOptionsModel.collectionId(), "testString"); - assertEquals(getTrainingExampleOptionsModel.queryId(), "testString"); - assertEquals(getTrainingExampleOptionsModel.exampleId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTrainingExampleOptionsError() throws Throwable { - new GetTrainingExampleOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/HtmlSettingsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/HtmlSettingsTest.java deleted file mode 100644 index e88be8750bb..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/HtmlSettingsTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the HtmlSettings model. */ -public class HtmlSettingsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testHtmlSettings() throws Throwable { - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - assertEquals(xPathPatternsModel.xpaths(), java.util.Arrays.asList("testString")); - - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("testString")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - assertEquals(htmlSettingsModel.excludeTagsCompletely(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagsKeepContent(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.keepContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.excludeContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.keepTagAttributes(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagAttributes(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(htmlSettingsModel); - - HtmlSettings htmlSettingsModelNew = TestUtilities.deserialize(json, HtmlSettings.class); - assertTrue(htmlSettingsModelNew instanceof HtmlSettings); - assertEquals(htmlSettingsModelNew.keepContent().toString(), xPathPatternsModel.toString()); - assertEquals(htmlSettingsModelNew.excludeContent().toString(), xPathPatternsModel.toString()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/IndexCapacityTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/IndexCapacityTest.java deleted file mode 100644 index 582875bf601..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/IndexCapacityTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the IndexCapacity model. */ -public class IndexCapacityTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testIndexCapacity() throws Throwable { - IndexCapacity indexCapacityModel = new IndexCapacity(); - assertNull(indexCapacityModel.getDocuments()); - assertNull(indexCapacityModel.getDiskUsage()); - assertNull(indexCapacityModel.getCollections()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsOptionsTest.java deleted file mode 100644 index 80194e357a2..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListCollectionFieldsOptions model. */ -public class ListCollectionFieldsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListCollectionFieldsOptions() throws Throwable { - ListCollectionFieldsOptions listCollectionFieldsOptionsModel = - new ListCollectionFieldsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(listCollectionFieldsOptionsModel.environmentId(), "testString"); - assertEquals(listCollectionFieldsOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListCollectionFieldsOptionsError() throws Throwable { - new ListCollectionFieldsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsResponseTest.java deleted file mode 100644 index e2f68335ced..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionFieldsResponseTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListCollectionFieldsResponse model. */ -public class ListCollectionFieldsResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListCollectionFieldsResponse() throws Throwable { - ListCollectionFieldsResponse listCollectionFieldsResponseModel = - new ListCollectionFieldsResponse(); - assertNull(listCollectionFieldsResponseModel.getFields()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionsOptionsTest.java deleted file mode 100644 index dfd2bd7cf60..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionsOptionsTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListCollectionsOptions model. */ -public class ListCollectionsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListCollectionsOptions() throws Throwable { - ListCollectionsOptions listCollectionsOptionsModel = - new ListCollectionsOptions.Builder().environmentId("testString").name("testString").build(); - assertEquals(listCollectionsOptionsModel.environmentId(), "testString"); - assertEquals(listCollectionsOptionsModel.name(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListCollectionsOptionsError() throws Throwable { - new ListCollectionsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionsResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionsResponseTest.java deleted file mode 100644 index 87a68a9ed87..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListCollectionsResponseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListCollectionsResponse model. */ -public class ListCollectionsResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListCollectionsResponse() throws Throwable { - ListCollectionsResponse listCollectionsResponseModel = new ListCollectionsResponse(); - assertNull(listCollectionsResponseModel.getCollections()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListConfigurationsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListConfigurationsOptionsTest.java deleted file mode 100644 index cfc6d5a42fa..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListConfigurationsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListConfigurationsOptions model. */ -public class ListConfigurationsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListConfigurationsOptions() throws Throwable { - ListConfigurationsOptions listConfigurationsOptionsModel = - new ListConfigurationsOptions.Builder() - .environmentId("testString") - .name("testString") - .build(); - assertEquals(listConfigurationsOptionsModel.environmentId(), "testString"); - assertEquals(listConfigurationsOptionsModel.name(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListConfigurationsOptionsError() throws Throwable { - new ListConfigurationsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListConfigurationsResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListConfigurationsResponseTest.java deleted file mode 100644 index ebd8ad4d4fc..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListConfigurationsResponseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListConfigurationsResponse model. */ -public class ListConfigurationsResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListConfigurationsResponse() throws Throwable { - ListConfigurationsResponse listConfigurationsResponseModel = new ListConfigurationsResponse(); - assertNull(listConfigurationsResponseModel.getConfigurations()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsOptionsTest.java deleted file mode 100644 index 951d62f7296..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsOptionsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListEnvironmentsOptions model. */ -public class ListEnvironmentsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListEnvironmentsOptions() throws Throwable { - ListEnvironmentsOptions listEnvironmentsOptionsModel = - new ListEnvironmentsOptions.Builder().name("testString").build(); - assertEquals(listEnvironmentsOptionsModel.name(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsResponseTest.java deleted file mode 100644 index 9f21d05ab57..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListEnvironmentsResponseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListEnvironmentsResponse model. */ -public class ListEnvironmentsResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListEnvironmentsResponse() throws Throwable { - ListEnvironmentsResponse listEnvironmentsResponseModel = new ListEnvironmentsResponse(); - assertNull(listEnvironmentsResponseModel.getEnvironments()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListExpansionsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListExpansionsOptionsTest.java deleted file mode 100644 index 127a09598f0..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListExpansionsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListExpansionsOptions model. */ -public class ListExpansionsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListExpansionsOptions() throws Throwable { - ListExpansionsOptions listExpansionsOptionsModel = - new ListExpansionsOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(listExpansionsOptionsModel.environmentId(), "testString"); - assertEquals(listExpansionsOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListExpansionsOptionsError() throws Throwable { - new ListExpansionsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListFieldsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListFieldsOptionsTest.java deleted file mode 100644 index 2ebb3e83027..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListFieldsOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListFieldsOptions model. */ -public class ListFieldsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListFieldsOptions() throws Throwable { - ListFieldsOptions listFieldsOptionsModel = - new ListFieldsOptions.Builder() - .environmentId("testString") - .collectionIds(java.util.Arrays.asList("testString")) - .build(); - assertEquals(listFieldsOptionsModel.environmentId(), "testString"); - assertEquals(listFieldsOptionsModel.collectionIds(), java.util.Arrays.asList("testString")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListFieldsOptionsError() throws Throwable { - new ListFieldsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListGatewaysOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListGatewaysOptionsTest.java deleted file mode 100644 index 69ea7382000..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListGatewaysOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListGatewaysOptions model. */ -public class ListGatewaysOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListGatewaysOptions() throws Throwable { - ListGatewaysOptions listGatewaysOptionsModel = - new ListGatewaysOptions.Builder().environmentId("testString").build(); - assertEquals(listGatewaysOptionsModel.environmentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListGatewaysOptionsError() throws Throwable { - new ListGatewaysOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListTrainingDataOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListTrainingDataOptionsTest.java deleted file mode 100644 index 2e13dcffdc4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListTrainingDataOptionsTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListTrainingDataOptions model. */ -public class ListTrainingDataOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListTrainingDataOptions() throws Throwable { - ListTrainingDataOptions listTrainingDataOptionsModel = - new ListTrainingDataOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .build(); - assertEquals(listTrainingDataOptionsModel.environmentId(), "testString"); - assertEquals(listTrainingDataOptionsModel.collectionId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListTrainingDataOptionsError() throws Throwable { - new ListTrainingDataOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListTrainingExamplesOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListTrainingExamplesOptionsTest.java deleted file mode 100644 index c4160649b1d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/ListTrainingExamplesOptionsTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListTrainingExamplesOptions model. */ -public class ListTrainingExamplesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListTrainingExamplesOptions() throws Throwable { - ListTrainingExamplesOptions listTrainingExamplesOptionsModel = - new ListTrainingExamplesOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .build(); - assertEquals(listTrainingExamplesOptionsModel.environmentId(), "testString"); - assertEquals(listTrainingExamplesOptionsModel.collectionId(), "testString"); - assertEquals(listTrainingExamplesOptionsModel.queryId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testListTrainingExamplesOptionsError() throws Throwable { - new ListTrainingExamplesOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsResultTest.java deleted file mode 100644 index b771dc71ba4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultDocumentsResultTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the LogQueryResponseResultDocumentsResult model. */ -public class LogQueryResponseResultDocumentsResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testLogQueryResponseResultDocumentsResult() throws Throwable { - LogQueryResponseResultDocumentsResult logQueryResponseResultDocumentsResultModel = - new LogQueryResponseResultDocumentsResult(); - assertNull(logQueryResponseResultDocumentsResultModel.getPosition()); - assertNull(logQueryResponseResultDocumentsResultModel.getDocumentId()); - assertNull(logQueryResponseResultDocumentsResultModel.getScore()); - assertNull(logQueryResponseResultDocumentsResultModel.getConfidence()); - assertNull(logQueryResponseResultDocumentsResultModel.getCollectionId()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultTest.java deleted file mode 100644 index f9a47ecd4d8..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/LogQueryResponseResultTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the LogQueryResponseResult model. */ -public class LogQueryResponseResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testLogQueryResponseResult() throws Throwable { - LogQueryResponseResult logQueryResponseResultModel = new LogQueryResponseResult(); - assertNull(logQueryResponseResultModel.getEnvironmentId()); - assertNull(logQueryResponseResultModel.getCustomerId()); - assertNull(logQueryResponseResultModel.getDocumentType()); - assertNull(logQueryResponseResultModel.getNaturalLanguageQuery()); - assertNull(logQueryResponseResultModel.getDocumentResults()); - assertNull(logQueryResponseResultModel.getCreatedTimestamp()); - assertNull(logQueryResponseResultModel.getClientTimestamp()); - assertNull(logQueryResponseResultModel.getQueryId()); - assertNull(logQueryResponseResultModel.getSessionToken()); - assertNull(logQueryResponseResultModel.getCollectionId()); - assertNull(logQueryResponseResultModel.getDisplayRank()); - assertNull(logQueryResponseResultModel.getDocumentId()); - assertNull(logQueryResponseResultModel.getEventType()); - assertNull(logQueryResponseResultModel.getResultType()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricAggregationResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricAggregationResultTest.java deleted file mode 100644 index c776ce9e687..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricAggregationResultTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the MetricAggregationResult model. */ -public class MetricAggregationResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testMetricAggregationResult() throws Throwable { - MetricAggregationResult metricAggregationResultModel = new MetricAggregationResult(); - assertNull(metricAggregationResultModel.getKeyAsString()); - assertNull(metricAggregationResultModel.getKey()); - assertNull(metricAggregationResultModel.getMatchingResults()); - assertNull(metricAggregationResultModel.getEventRate()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricAggregationTest.java deleted file mode 100644 index c57836b3abd..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricAggregationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the MetricAggregation model. */ -public class MetricAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testMetricAggregation() throws Throwable { - MetricAggregation metricAggregationModel = new MetricAggregation(); - assertNull(metricAggregationModel.getInterval()); - assertNull(metricAggregationModel.getEventType()); - assertNull(metricAggregationModel.getResults()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricResponseTest.java deleted file mode 100644 index 6040800f5a7..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricResponseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the MetricResponse model. */ -public class MetricResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testMetricResponse() throws Throwable { - MetricResponse metricResponseModel = new MetricResponse(); - assertNull(metricResponseModel.getAggregations()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationResultTest.java deleted file mode 100644 index e06d469376a..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationResultTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the MetricTokenAggregationResult model. */ -public class MetricTokenAggregationResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testMetricTokenAggregationResult() throws Throwable { - MetricTokenAggregationResult metricTokenAggregationResultModel = - new MetricTokenAggregationResult(); - assertNull(metricTokenAggregationResultModel.getKey()); - assertNull(metricTokenAggregationResultModel.getMatchingResults()); - assertNull(metricTokenAggregationResultModel.getEventRate()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationTest.java deleted file mode 100644 index 0944f3f501d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenAggregationTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the MetricTokenAggregation model. */ -public class MetricTokenAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testMetricTokenAggregation() throws Throwable { - MetricTokenAggregation metricTokenAggregationModel = new MetricTokenAggregation(); - assertNull(metricTokenAggregationModel.getEventType()); - assertNull(metricTokenAggregationModel.getResults()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenResponseTest.java deleted file mode 100644 index d7e6acf5547..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/MetricTokenResponseTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the MetricTokenResponse model. */ -public class MetricTokenResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testMetricTokenResponse() throws Throwable { - MetricTokenResponse metricTokenResponseModel = new MetricTokenResponse(); - assertNull(metricTokenResponseModel.getAggregations()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentConceptsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentConceptsTest.java deleted file mode 100644 index 8a3a337ab43..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentConceptsTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentConcepts model. */ -public class NluEnrichmentConceptsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentConcepts() throws Throwable { - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(nluEnrichmentConceptsModel); - - NluEnrichmentConcepts nluEnrichmentConceptsModelNew = - TestUtilities.deserialize(json, NluEnrichmentConcepts.class); - assertTrue(nluEnrichmentConceptsModelNew instanceof NluEnrichmentConcepts); - assertEquals(nluEnrichmentConceptsModelNew.limit(), Long.valueOf("26")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEmotionTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEmotionTest.java deleted file mode 100644 index e725c11c93c..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEmotionTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentEmotion model. */ -public class NluEnrichmentEmotionTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentEmotion() throws Throwable { - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(nluEnrichmentEmotionModel); - - NluEnrichmentEmotion nluEnrichmentEmotionModelNew = - TestUtilities.deserialize(json, NluEnrichmentEmotion.class); - assertTrue(nluEnrichmentEmotionModelNew instanceof NluEnrichmentEmotion); - assertEquals(nluEnrichmentEmotionModelNew.document(), Boolean.valueOf(true)); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEntitiesTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEntitiesTest.java deleted file mode 100644 index d05172a0a64..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentEntitiesTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentEntities model. */ -public class NluEnrichmentEntitiesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentEntities() throws Throwable { - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "testString"); - - String json = TestUtilities.serialize(nluEnrichmentEntitiesModel); - - NluEnrichmentEntities nluEnrichmentEntitiesModelNew = - TestUtilities.deserialize(json, NluEnrichmentEntities.class); - assertTrue(nluEnrichmentEntitiesModelNew instanceof NluEnrichmentEntities); - assertEquals(nluEnrichmentEntitiesModelNew.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModelNew.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModelNew.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModelNew.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModelNew.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModelNew.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModelNew.model(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentFeaturesTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentFeaturesTest.java deleted file mode 100644 index 93c77ae1e04..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentFeaturesTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentFeatures model. */ -public class NluEnrichmentFeaturesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentFeatures() throws Throwable { - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("26")); - - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "testString"); - - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("26")); - - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "testString"); - - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("26")); - - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - assertEquals(nluEnrichmentFeaturesModel.keywords(), nluEnrichmentKeywordsModel); - assertEquals(nluEnrichmentFeaturesModel.entities(), nluEnrichmentEntitiesModel); - assertEquals(nluEnrichmentFeaturesModel.sentiment(), nluEnrichmentSentimentModel); - assertEquals(nluEnrichmentFeaturesModel.emotion(), nluEnrichmentEmotionModel); - assertEquals( - nluEnrichmentFeaturesModel.categories(), - java.util.Collections.singletonMap("anyKey", "anyValue")); - assertEquals(nluEnrichmentFeaturesModel.semanticRoles(), nluEnrichmentSemanticRolesModel); - assertEquals(nluEnrichmentFeaturesModel.relations(), nluEnrichmentRelationsModel); - assertEquals(nluEnrichmentFeaturesModel.concepts(), nluEnrichmentConceptsModel); - - String json = TestUtilities.serialize(nluEnrichmentFeaturesModel); - - NluEnrichmentFeatures nluEnrichmentFeaturesModelNew = - TestUtilities.deserialize(json, NluEnrichmentFeatures.class); - assertTrue(nluEnrichmentFeaturesModelNew instanceof NluEnrichmentFeatures); - assertEquals( - nluEnrichmentFeaturesModelNew.keywords().toString(), nluEnrichmentKeywordsModel.toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.entities().toString(), nluEnrichmentEntitiesModel.toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.sentiment().toString(), - nluEnrichmentSentimentModel.toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.emotion().toString(), nluEnrichmentEmotionModel.toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.categories().toString(), - java.util.Collections.singletonMap("anyKey", "anyValue").toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.semanticRoles().toString(), - nluEnrichmentSemanticRolesModel.toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.relations().toString(), - nluEnrichmentRelationsModel.toString()); - assertEquals( - nluEnrichmentFeaturesModelNew.concepts().toString(), nluEnrichmentConceptsModel.toString()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentKeywordsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentKeywordsTest.java deleted file mode 100644 index cea1b8cf10a..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentKeywordsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentKeywords model. */ -public class NluEnrichmentKeywordsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentKeywords() throws Throwable { - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(nluEnrichmentKeywordsModel); - - NluEnrichmentKeywords nluEnrichmentKeywordsModelNew = - TestUtilities.deserialize(json, NluEnrichmentKeywords.class); - assertTrue(nluEnrichmentKeywordsModelNew instanceof NluEnrichmentKeywords); - assertEquals(nluEnrichmentKeywordsModelNew.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModelNew.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModelNew.limit(), Long.valueOf("26")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentRelationsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentRelationsTest.java deleted file mode 100644 index 777e296b325..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentRelationsTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentRelations model. */ -public class NluEnrichmentRelationsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentRelations() throws Throwable { - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "testString"); - - String json = TestUtilities.serialize(nluEnrichmentRelationsModel); - - NluEnrichmentRelations nluEnrichmentRelationsModelNew = - TestUtilities.deserialize(json, NluEnrichmentRelations.class); - assertTrue(nluEnrichmentRelationsModelNew instanceof NluEnrichmentRelations); - assertEquals(nluEnrichmentRelationsModelNew.model(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSemanticRolesTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSemanticRolesTest.java deleted file mode 100644 index 1df2e7c2902..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSemanticRolesTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentSemanticRoles model. */ -public class NluEnrichmentSemanticRolesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentSemanticRoles() throws Throwable { - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(nluEnrichmentSemanticRolesModel); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModelNew = - TestUtilities.deserialize(json, NluEnrichmentSemanticRoles.class); - assertTrue(nluEnrichmentSemanticRolesModelNew instanceof NluEnrichmentSemanticRoles); - assertEquals(nluEnrichmentSemanticRolesModelNew.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModelNew.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModelNew.limit(), Long.valueOf("26")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSentimentTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSentimentTest.java deleted file mode 100644 index 6a30965c252..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NluEnrichmentSentimentTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NluEnrichmentSentiment model. */ -public class NluEnrichmentSentimentTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNluEnrichmentSentiment() throws Throwable { - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(nluEnrichmentSentimentModel); - - NluEnrichmentSentiment nluEnrichmentSentimentModelNew = - TestUtilities.deserialize(json, NluEnrichmentSentiment.class); - assertTrue(nluEnrichmentSentimentModelNew instanceof NluEnrichmentSentiment); - assertEquals(nluEnrichmentSentimentModelNew.document(), Boolean.valueOf(true)); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NormalizationOperationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NormalizationOperationTest.java deleted file mode 100644 index 1000f68fa00..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NormalizationOperationTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the NormalizationOperation model. */ -public class NormalizationOperationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNormalizationOperation() throws Throwable { - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("copy") - .sourceField("testString") - .destinationField("testString") - .build(); - assertEquals(normalizationOperationModel.operation(), "copy"); - assertEquals(normalizationOperationModel.sourceField(), "testString"); - assertEquals(normalizationOperationModel.destinationField(), "testString"); - - String json = TestUtilities.serialize(normalizationOperationModel); - - NormalizationOperation normalizationOperationModelNew = - TestUtilities.deserialize(json, NormalizationOperation.class); - assertTrue(normalizationOperationModelNew instanceof NormalizationOperation); - assertEquals(normalizationOperationModelNew.operation(), "copy"); - assertEquals(normalizationOperationModelNew.sourceField(), "testString"); - assertEquals(normalizationOperationModelNew.destinationField(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NoticeTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NoticeTest.java deleted file mode 100644 index 5f4d6a40324..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/NoticeTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Notice model. */ -public class NoticeTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testNotice() throws Throwable { - Notice noticeModel = new Notice(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/PdfHeadingDetectionTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/PdfHeadingDetectionTest.java deleted file mode 100644 index 6b603409cf4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/PdfHeadingDetectionTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the PdfHeadingDetection model. */ -public class PdfHeadingDetectionTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testPdfHeadingDetection() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - assertEquals(pdfHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - - String json = TestUtilities.serialize(pdfHeadingDetectionModel); - - PdfHeadingDetection pdfHeadingDetectionModelNew = - TestUtilities.deserialize(json, PdfHeadingDetection.class); - assertTrue(pdfHeadingDetectionModelNew instanceof PdfHeadingDetection); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/PdfSettingsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/PdfSettingsTest.java deleted file mode 100644 index bc83bd6dfd9..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/PdfSettingsTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the PdfSettings model. */ -public class PdfSettingsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testPdfSettings() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - assertEquals(pdfHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - assertEquals(pdfSettingsModel.heading(), pdfHeadingDetectionModel); - - String json = TestUtilities.serialize(pdfSettingsModel); - - PdfSettings pdfSettingsModelNew = TestUtilities.deserialize(json, PdfSettings.class); - assertTrue(pdfSettingsModelNew instanceof PdfSettings); - assertEquals(pdfSettingsModelNew.heading().toString(), pdfHeadingDetectionModel.toString()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryCalculationAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryCalculationAggregationTest.java deleted file mode 100644 index 137b6670048..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryCalculationAggregationTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryCalculationAggregation model. */ -public class QueryCalculationAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryCalculationAggregation() throws Throwable { - QueryCalculationAggregation queryCalculationAggregationModel = - new QueryCalculationAggregation(); - assertNull(queryCalculationAggregationModel.getType()); - assertNull(queryCalculationAggregationModel.getField()); - assertNull(queryCalculationAggregationModel.getValue()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryFilterAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryFilterAggregationTest.java deleted file mode 100644 index 883b65ffb2f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryFilterAggregationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryFilterAggregation model. */ -public class QueryFilterAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryFilterAggregation() throws Throwable { - QueryFilterAggregation queryFilterAggregationModel = new QueryFilterAggregation(); - assertNull(queryFilterAggregationModel.getType()); - assertNull(queryFilterAggregationModel.getMatch()); - assertNull(queryFilterAggregationModel.getMatchingResults()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationResultTest.java deleted file mode 100644 index a13e1008634..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationResultTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryHistogramAggregationResult model. */ -public class QueryHistogramAggregationResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryHistogramAggregationResult() throws Throwable { - QueryHistogramAggregationResult queryHistogramAggregationResultModel = - new QueryHistogramAggregationResult(); - assertNull(queryHistogramAggregationResultModel.getKey()); - assertNull(queryHistogramAggregationResultModel.getMatchingResults()); - assertNull(queryHistogramAggregationResultModel.getAggregations()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationTest.java deleted file mode 100644 index a54a7160824..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryHistogramAggregationTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryHistogramAggregation model. */ -public class QueryHistogramAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryHistogramAggregation() throws Throwable { - QueryHistogramAggregation queryHistogramAggregationModel = new QueryHistogramAggregation(); - assertNull(queryHistogramAggregationModel.getType()); - assertNull(queryHistogramAggregationModel.getField()); - assertNull(queryHistogramAggregationModel.getInterval()); - assertNull(queryHistogramAggregationModel.getName()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryLogOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryLogOptionsTest.java deleted file mode 100644 index 2bdbea22eae..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryLogOptionsTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryLogOptions model. */ -public class QueryLogOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryLogOptions() throws Throwable { - QueryLogOptions queryLogOptionsModel = - new QueryLogOptions.Builder() - .filter("testString") - .query("testString") - .count(Long.valueOf("10")) - .offset(Long.valueOf("26")) - .sort(java.util.Arrays.asList("testString")) - .build(); - assertEquals(queryLogOptionsModel.filter(), "testString"); - assertEquals(queryLogOptionsModel.query(), "testString"); - assertEquals(queryLogOptionsModel.count(), Long.valueOf("10")); - assertEquals(queryLogOptionsModel.offset(), Long.valueOf("26")); - assertEquals(queryLogOptionsModel.sort(), java.util.Arrays.asList("testString")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNestedAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNestedAggregationTest.java deleted file mode 100644 index 7fa78163ad9..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNestedAggregationTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryNestedAggregation model. */ -public class QueryNestedAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryNestedAggregation() throws Throwable { - QueryNestedAggregation queryNestedAggregationModel = new QueryNestedAggregation(); - assertNull(queryNestedAggregationModel.getType()); - assertNull(queryNestedAggregationModel.getPath()); - assertNull(queryNestedAggregationModel.getMatchingResults()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesOptionsTest.java deleted file mode 100644 index e4368501563..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesOptionsTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryNoticesOptions model. */ -public class QueryNoticesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryNoticesOptions() throws Throwable { - QueryNoticesOptions queryNoticesOptionsModel = - new QueryNoticesOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .passages(true) - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn(java.util.Arrays.asList("testString")) - .offset(Long.valueOf("26")) - .sort(java.util.Arrays.asList("testString")) - .highlight(false) - .passagesFields(java.util.Arrays.asList("testString")) - .passagesCount(Long.valueOf("10")) - .passagesCharacters(Long.valueOf("400")) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds(java.util.Arrays.asList("testString")) - .similarFields(java.util.Arrays.asList("testString")) - .build(); - assertEquals(queryNoticesOptionsModel.environmentId(), "testString"); - assertEquals(queryNoticesOptionsModel.collectionId(), "testString"); - assertEquals(queryNoticesOptionsModel.filter(), "testString"); - assertEquals(queryNoticesOptionsModel.query(), "testString"); - assertEquals(queryNoticesOptionsModel.naturalLanguageQuery(), "testString"); - assertEquals(queryNoticesOptionsModel.passages(), Boolean.valueOf(true)); - assertEquals(queryNoticesOptionsModel.aggregation(), "testString"); - assertEquals(queryNoticesOptionsModel.count(), Long.valueOf("10")); - assertEquals(queryNoticesOptionsModel.xReturn(), java.util.Arrays.asList("testString")); - assertEquals(queryNoticesOptionsModel.offset(), Long.valueOf("26")); - assertEquals(queryNoticesOptionsModel.sort(), java.util.Arrays.asList("testString")); - assertEquals(queryNoticesOptionsModel.highlight(), Boolean.valueOf(false)); - assertEquals(queryNoticesOptionsModel.passagesFields(), java.util.Arrays.asList("testString")); - assertEquals(queryNoticesOptionsModel.passagesCount(), Long.valueOf("10")); - assertEquals(queryNoticesOptionsModel.passagesCharacters(), Long.valueOf("400")); - assertEquals(queryNoticesOptionsModel.deduplicateField(), "testString"); - assertEquals(queryNoticesOptionsModel.similar(), Boolean.valueOf(false)); - assertEquals( - queryNoticesOptionsModel.similarDocumentIds(), java.util.Arrays.asList("testString")); - assertEquals(queryNoticesOptionsModel.similarFields(), java.util.Arrays.asList("testString")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testQueryNoticesOptionsError() throws Throwable { - new QueryNoticesOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesResponseTest.java deleted file mode 100644 index f22556ec0e6..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesResponseTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryNoticesResponse model. */ -public class QueryNoticesResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryNoticesResponse() throws Throwable { - QueryNoticesResponse queryNoticesResponseModel = new QueryNoticesResponse(); - assertNull(queryNoticesResponseModel.getMatchingResults()); - assertNull(queryNoticesResponseModel.getResults()); - assertNull(queryNoticesResponseModel.getAggregations()); - assertNull(queryNoticesResponseModel.getPassages()); - assertNull(queryNoticesResponseModel.getDuplicatesRemoved()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesResultTest.java deleted file mode 100644 index 8d3d190eddc..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryNoticesResultTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryNoticesResult model. */ -public class QueryNoticesResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryNoticesResult() throws Throwable { - QueryNoticesResult queryNoticesResultModel = new QueryNoticesResult(); - assertNull(queryNoticesResultModel.getId()); - assertNull(queryNoticesResultModel.getMetadata()); - assertNull(queryNoticesResultModel.getCollectionId()); - assertNull(queryNoticesResultModel.getResultMetadata()); - assertNull(queryNoticesResultModel.getCode()); - assertNull(queryNoticesResultModel.getFilename()); - assertNull(queryNoticesResultModel.getFileType()); - assertNull(queryNoticesResultModel.getSha1()); - assertNull(queryNoticesResultModel.getNotices()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryOptionsTest.java deleted file mode 100644 index bf2a3d93149..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryOptionsTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryOptions model. */ -public class QueryOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryOptions() throws Throwable { - QueryOptions queryOptionsModel = - new QueryOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .filter("testString") - .query("testString") - .naturalLanguageQuery("testString") - .passages(true) - .aggregation("testString") - .count(Long.valueOf("10")) - .xReturn("testString") - .offset(Long.valueOf("26")) - .sort("testString") - .highlight(false) - .passagesFields("testString") - .passagesCount(Long.valueOf("10")) - .passagesCharacters(Long.valueOf("400")) - .deduplicate(false) - .deduplicateField("testString") - .similar(false) - .similarDocumentIds("testString") - .similarFields("testString") - .bias("testString") - .spellingSuggestions(false) - .xWatsonLoggingOptOut(false) - .build(); - assertEquals(queryOptionsModel.environmentId(), "testString"); - assertEquals(queryOptionsModel.collectionId(), "testString"); - assertEquals(queryOptionsModel.filter(), "testString"); - assertEquals(queryOptionsModel.query(), "testString"); - assertEquals(queryOptionsModel.naturalLanguageQuery(), "testString"); - assertEquals(queryOptionsModel.passages(), Boolean.valueOf(true)); - assertEquals(queryOptionsModel.aggregation(), "testString"); - assertEquals(queryOptionsModel.count(), Long.valueOf("10")); - assertEquals(queryOptionsModel.xReturn(), "testString"); - assertEquals(queryOptionsModel.offset(), Long.valueOf("26")); - assertEquals(queryOptionsModel.sort(), "testString"); - assertEquals(queryOptionsModel.highlight(), Boolean.valueOf(false)); - assertEquals(queryOptionsModel.passagesFields(), "testString"); - assertEquals(queryOptionsModel.passagesCount(), Long.valueOf("10")); - assertEquals(queryOptionsModel.passagesCharacters(), Long.valueOf("400")); - assertEquals(queryOptionsModel.deduplicate(), Boolean.valueOf(false)); - assertEquals(queryOptionsModel.deduplicateField(), "testString"); - assertEquals(queryOptionsModel.similar(), Boolean.valueOf(false)); - assertEquals(queryOptionsModel.similarDocumentIds(), "testString"); - assertEquals(queryOptionsModel.similarFields(), "testString"); - assertEquals(queryOptionsModel.bias(), "testString"); - assertEquals(queryOptionsModel.spellingSuggestions(), Boolean.valueOf(false)); - assertEquals(queryOptionsModel.xWatsonLoggingOptOut(), Boolean.valueOf(false)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testQueryOptionsError() throws Throwable { - new QueryOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryPassagesTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryPassagesTest.java deleted file mode 100644 index 62ba7f801e1..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryPassagesTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryPassages model. */ -public class QueryPassagesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryPassages() throws Throwable { - QueryPassages queryPassagesModel = new QueryPassages(); - assertNull(queryPassagesModel.getDocumentId()); - assertNull(queryPassagesModel.getPassageScore()); - assertNull(queryPassagesModel.getPassageText()); - assertNull(queryPassagesModel.getStartOffset()); - assertNull(queryPassagesModel.getEndOffset()); - assertNull(queryPassagesModel.getField()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResponseTest.java deleted file mode 100644 index 07ca90ddda4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResponseTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryResponse model. */ -public class QueryResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryResponse() throws Throwable { - QueryResponse queryResponseModel = new QueryResponse(); - assertNull(queryResponseModel.getMatchingResults()); - assertNull(queryResponseModel.getResults()); - assertNull(queryResponseModel.getAggregations()); - assertNull(queryResponseModel.getPassages()); - assertNull(queryResponseModel.getDuplicatesRemoved()); - assertNull(queryResponseModel.getSessionToken()); - assertNull(queryResponseModel.getRetrievalDetails()); - assertNull(queryResponseModel.getSuggestedQuery()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResultMetadataTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResultMetadataTest.java deleted file mode 100644 index fd9230b5283..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResultMetadataTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryResultMetadata model. */ -public class QueryResultMetadataTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryResultMetadata() throws Throwable { - QueryResultMetadata queryResultMetadataModel = new QueryResultMetadata(); - assertNull(queryResultMetadataModel.getScore()); - assertNull(queryResultMetadataModel.getConfidence()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResultTest.java deleted file mode 100644 index 11b72ce56b9..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryResultTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryResult model. */ -public class QueryResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryResult() throws Throwable { - QueryResult queryResultModel = new QueryResult(); - assertNull(queryResultModel.getId()); - assertNull(queryResultModel.getMetadata()); - assertNull(queryResultModel.getCollectionId()); - assertNull(queryResultModel.getResultMetadata()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationResultTest.java deleted file mode 100644 index d0e9c3f5d83..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationResultTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryTermAggregationResult model. */ -public class QueryTermAggregationResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryTermAggregationResult() throws Throwable { - QueryTermAggregationResult queryTermAggregationResultModel = new QueryTermAggregationResult(); - assertNull(queryTermAggregationResultModel.getKey()); - assertNull(queryTermAggregationResultModel.getMatchingResults()); - assertNull(queryTermAggregationResultModel.getRelevancy()); - assertNull(queryTermAggregationResultModel.getTotalMatchingDocuments()); - assertNull(queryTermAggregationResultModel.getEstimatedMatchingDocuments()); - assertNull(queryTermAggregationResultModel.getAggregations()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationTest.java deleted file mode 100644 index ecb524ff51f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTermAggregationTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryTermAggregation model. */ -public class QueryTermAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryTermAggregation() throws Throwable { - QueryTermAggregation queryTermAggregationModel = new QueryTermAggregation(); - assertNull(queryTermAggregationModel.getType()); - assertNull(queryTermAggregationModel.getField()); - assertNull(queryTermAggregationModel.getCount()); - assertNull(queryTermAggregationModel.getName()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationResultTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationResultTest.java deleted file mode 100644 index ee0b0a778d8..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationResultTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryTimesliceAggregationResult model. */ -public class QueryTimesliceAggregationResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryTimesliceAggregationResult() throws Throwable { - QueryTimesliceAggregationResult queryTimesliceAggregationResultModel = - new QueryTimesliceAggregationResult(); - assertNull(queryTimesliceAggregationResultModel.getKeyAsString()); - assertNull(queryTimesliceAggregationResultModel.getKey()); - assertNull(queryTimesliceAggregationResultModel.getMatchingResults()); - assertNull(queryTimesliceAggregationResultModel.getAggregations()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationTest.java deleted file mode 100644 index f485db48ef0..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTimesliceAggregationTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryTimesliceAggregation model. */ -public class QueryTimesliceAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryTimesliceAggregation() throws Throwable { - QueryTimesliceAggregation queryTimesliceAggregationModel = new QueryTimesliceAggregation(); - assertNull(queryTimesliceAggregationModel.getType()); - assertNull(queryTimesliceAggregationModel.getField()); - assertNull(queryTimesliceAggregationModel.getInterval()); - assertNull(queryTimesliceAggregationModel.getName()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationTest.java deleted file mode 100644 index 4917969d86c..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/QueryTopHitsAggregationTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the QueryTopHitsAggregation model. */ -public class QueryTopHitsAggregationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testQueryTopHitsAggregation() throws Throwable { - QueryTopHitsAggregation queryTopHitsAggregationModel = new QueryTopHitsAggregation(); - assertNull(queryTopHitsAggregationModel.getType()); - assertNull(queryTopHitsAggregationModel.getSize()); - assertNull(queryTopHitsAggregationModel.getName()); - assertNull(queryTopHitsAggregationModel.getHits()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/RetrievalDetailsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/RetrievalDetailsTest.java deleted file mode 100644 index b330baa87b7..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/RetrievalDetailsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the RetrievalDetails model. */ -public class RetrievalDetailsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testRetrievalDetails() throws Throwable { - RetrievalDetails retrievalDetailsModel = new RetrievalDetails(); - assertNull(retrievalDetailsModel.getDocumentRetrievalStrategy()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SduStatusCustomFieldsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SduStatusCustomFieldsTest.java deleted file mode 100644 index 449ad4b31bb..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SduStatusCustomFieldsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SduStatusCustomFields model. */ -public class SduStatusCustomFieldsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSduStatusCustomFields() throws Throwable { - SduStatusCustomFields sduStatusCustomFieldsModel = new SduStatusCustomFields(); - assertNull(sduStatusCustomFieldsModel.getDefined()); - assertNull(sduStatusCustomFieldsModel.getMaximumAllowed()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SduStatusTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SduStatusTest.java deleted file mode 100644 index 2dc022fa53f..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SduStatusTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SduStatus model. */ -public class SduStatusTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSduStatus() throws Throwable { - SduStatus sduStatusModel = new SduStatus(); - assertNull(sduStatusModel.isEnabled()); - assertNull(sduStatusModel.getTotalAnnotatedPages()); - assertNull(sduStatusModel.getTotalPages()); - assertNull(sduStatusModel.getTotalDocuments()); - assertNull(sduStatusModel.getCustomFields()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SearchStatusTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SearchStatusTest.java deleted file mode 100644 index 557c077f5e9..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SearchStatusTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SearchStatus model. */ -public class SearchStatusTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSearchStatus() throws Throwable { - SearchStatus searchStatusModel = new SearchStatus(); - assertNull(searchStatusModel.getScope()); - assertNull(searchStatusModel.getStatus()); - assertNull(searchStatusModel.getStatusDescription()); - assertNull(searchStatusModel.getLastTrained()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SegmentSettingsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SegmentSettingsTest.java deleted file mode 100644 index ac444654aae..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SegmentSettingsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SegmentSettings model. */ -public class SegmentSettingsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSegmentSettings() throws Throwable { - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(false) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("testString")) - .build(); - assertEquals(segmentSettingsModel.enabled(), Boolean.valueOf(false)); - assertEquals(segmentSettingsModel.selectorTags(), java.util.Arrays.asList("h1", "h2")); - assertEquals(segmentSettingsModel.annotatedFields(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(segmentSettingsModel); - - SegmentSettings segmentSettingsModelNew = - TestUtilities.deserialize(json, SegmentSettings.class); - assertTrue(segmentSettingsModelNew instanceof SegmentSettings); - assertEquals(segmentSettingsModelNew.enabled(), Boolean.valueOf(false)); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsBucketsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsBucketsTest.java deleted file mode 100644 index bcd8445aa7d..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsBucketsTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceOptionsBuckets model. */ -public class SourceOptionsBucketsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceOptionsBuckets() throws Throwable { - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsBucketsModel.name(), "testString"); - assertEquals(sourceOptionsBucketsModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(sourceOptionsBucketsModel); - - SourceOptionsBuckets sourceOptionsBucketsModelNew = - TestUtilities.deserialize(json, SourceOptionsBuckets.class); - assertTrue(sourceOptionsBucketsModelNew instanceof SourceOptionsBuckets); - assertEquals(sourceOptionsBucketsModelNew.name(), "testString"); - assertEquals(sourceOptionsBucketsModelNew.limit(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testSourceOptionsBucketsError() throws Throwable { - new SourceOptionsBuckets.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsFolderTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsFolderTest.java deleted file mode 100644 index c8a7b2aa599..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsFolderTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceOptionsFolder model. */ -public class SourceOptionsFolderTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceOptionsFolder() throws Throwable { - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsFolderModel.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModel.folderId(), "testString"); - assertEquals(sourceOptionsFolderModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(sourceOptionsFolderModel); - - SourceOptionsFolder sourceOptionsFolderModelNew = - TestUtilities.deserialize(json, SourceOptionsFolder.class); - assertTrue(sourceOptionsFolderModelNew instanceof SourceOptionsFolder); - assertEquals(sourceOptionsFolderModelNew.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModelNew.folderId(), "testString"); - assertEquals(sourceOptionsFolderModelNew.limit(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testSourceOptionsFolderError() throws Throwable { - new SourceOptionsFolder.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsObjectTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsObjectTest.java deleted file mode 100644 index b3c12a7d9aa..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsObjectTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceOptionsObject model. */ -public class SourceOptionsObjectTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceOptionsObject() throws Throwable { - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsObjectModel.name(), "testString"); - assertEquals(sourceOptionsObjectModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(sourceOptionsObjectModel); - - SourceOptionsObject sourceOptionsObjectModelNew = - TestUtilities.deserialize(json, SourceOptionsObject.class); - assertTrue(sourceOptionsObjectModelNew instanceof SourceOptionsObject); - assertEquals(sourceOptionsObjectModelNew.name(), "testString"); - assertEquals(sourceOptionsObjectModelNew.limit(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testSourceOptionsObjectError() throws Throwable { - new SourceOptionsObject.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsSiteCollTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsSiteCollTest.java deleted file mode 100644 index 1316e7b5372..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsSiteCollTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceOptionsSiteColl model. */ -public class SourceOptionsSiteCollTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceOptionsSiteColl() throws Throwable { - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsSiteCollModel.siteCollectionPath(), "testString"); - assertEquals(sourceOptionsSiteCollModel.limit(), Long.valueOf("26")); - - String json = TestUtilities.serialize(sourceOptionsSiteCollModel); - - SourceOptionsSiteColl sourceOptionsSiteCollModelNew = - TestUtilities.deserialize(json, SourceOptionsSiteColl.class); - assertTrue(sourceOptionsSiteCollModelNew instanceof SourceOptionsSiteColl); - assertEquals(sourceOptionsSiteCollModelNew.siteCollectionPath(), "testString"); - assertEquals(sourceOptionsSiteCollModelNew.limit(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testSourceOptionsSiteCollError() throws Throwable { - new SourceOptionsSiteColl.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsTest.java deleted file mode 100644 index 9a19a304315..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceOptions model. */ -public class SourceOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceOptions() throws Throwable { - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsFolderModel.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModel.folderId(), "testString"); - assertEquals(sourceOptionsFolderModel.limit(), Long.valueOf("26")); - - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsObjectModel.name(), "testString"); - assertEquals(sourceOptionsObjectModel.limit(), Long.valueOf("26")); - - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsSiteCollModel.siteCollectionPath(), "testString"); - assertEquals(sourceOptionsSiteCollModel.limit(), Long.valueOf("26")); - - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - assertEquals(sourceOptionsWebCrawlModel.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModel.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModel.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModel.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModel.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModel.overrideRobotsTxt(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.blacklist(), java.util.Arrays.asList("testString")); - - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsBucketsModel.name(), "testString"); - assertEquals(sourceOptionsBucketsModel.limit(), Long.valueOf("26")); - - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - assertEquals(sourceOptionsModel.folders(), java.util.Arrays.asList(sourceOptionsFolderModel)); - assertEquals(sourceOptionsModel.objects(), java.util.Arrays.asList(sourceOptionsObjectModel)); - assertEquals( - sourceOptionsModel.siteCollections(), java.util.Arrays.asList(sourceOptionsSiteCollModel)); - assertEquals(sourceOptionsModel.urls(), java.util.Arrays.asList(sourceOptionsWebCrawlModel)); - assertEquals(sourceOptionsModel.buckets(), java.util.Arrays.asList(sourceOptionsBucketsModel)); - assertEquals(sourceOptionsModel.crawlAllBuckets(), Boolean.valueOf(true)); - - String json = TestUtilities.serialize(sourceOptionsModel); - - SourceOptions sourceOptionsModelNew = TestUtilities.deserialize(json, SourceOptions.class); - assertTrue(sourceOptionsModelNew instanceof SourceOptions); - assertEquals(sourceOptionsModelNew.crawlAllBuckets(), Boolean.valueOf(true)); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsWebCrawlTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsWebCrawlTest.java deleted file mode 100644 index 8c094565eb9..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceOptionsWebCrawlTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceOptionsWebCrawl model. */ -public class SourceOptionsWebCrawlTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceOptionsWebCrawl() throws Throwable { - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - assertEquals(sourceOptionsWebCrawlModel.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModel.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModel.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModel.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModel.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModel.overrideRobotsTxt(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.blacklist(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(sourceOptionsWebCrawlModel); - - SourceOptionsWebCrawl sourceOptionsWebCrawlModelNew = - TestUtilities.deserialize(json, SourceOptionsWebCrawl.class); - assertTrue(sourceOptionsWebCrawlModelNew instanceof SourceOptionsWebCrawl); - assertEquals(sourceOptionsWebCrawlModelNew.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModelNew.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModelNew.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModelNew.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModelNew.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModelNew.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModelNew.overrideRobotsTxt(), Boolean.valueOf(false)); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testSourceOptionsWebCrawlError() throws Throwable { - new SourceOptionsWebCrawl.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceScheduleTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceScheduleTest.java deleted file mode 100644 index 889bde8bb80..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceScheduleTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceSchedule model. */ -public class SourceScheduleTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceSchedule() throws Throwable { - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("daily") - .build(); - assertEquals(sourceScheduleModel.enabled(), Boolean.valueOf(true)); - assertEquals(sourceScheduleModel.timeZone(), "America/New_York"); - assertEquals(sourceScheduleModel.frequency(), "daily"); - - String json = TestUtilities.serialize(sourceScheduleModel); - - SourceSchedule sourceScheduleModelNew = TestUtilities.deserialize(json, SourceSchedule.class); - assertTrue(sourceScheduleModelNew instanceof SourceSchedule); - assertEquals(sourceScheduleModelNew.enabled(), Boolean.valueOf(true)); - assertEquals(sourceScheduleModelNew.timeZone(), "America/New_York"); - assertEquals(sourceScheduleModelNew.frequency(), "daily"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceStatusTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceStatusTest.java deleted file mode 100644 index 307714a701c..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceStatusTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the SourceStatus model. */ -public class SourceStatusTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSourceStatus() throws Throwable { - SourceStatus sourceStatusModel = new SourceStatus(); - assertNull(sourceStatusModel.getStatus()); - assertNull(sourceStatusModel.getNextCrawl()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceTest.java deleted file mode 100644 index 082e1f2df68..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/SourceTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Source model. */ -public class SourceTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testSource() throws Throwable { - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("daily") - .build(); - assertEquals(sourceScheduleModel.enabled(), Boolean.valueOf(true)); - assertEquals(sourceScheduleModel.timeZone(), "America/New_York"); - assertEquals(sourceScheduleModel.frequency(), "daily"); - - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsFolderModel.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModel.folderId(), "testString"); - assertEquals(sourceOptionsFolderModel.limit(), Long.valueOf("26")); - - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsObjectModel.name(), "testString"); - assertEquals(sourceOptionsObjectModel.limit(), Long.valueOf("26")); - - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsSiteCollModel.siteCollectionPath(), "testString"); - assertEquals(sourceOptionsSiteCollModel.limit(), Long.valueOf("26")); - - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - assertEquals(sourceOptionsWebCrawlModel.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModel.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModel.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModel.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModel.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModel.overrideRobotsTxt(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.blacklist(), java.util.Arrays.asList("testString")); - - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsBucketsModel.name(), "testString"); - assertEquals(sourceOptionsBucketsModel.limit(), Long.valueOf("26")); - - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - assertEquals(sourceOptionsModel.folders(), java.util.Arrays.asList(sourceOptionsFolderModel)); - assertEquals(sourceOptionsModel.objects(), java.util.Arrays.asList(sourceOptionsObjectModel)); - assertEquals( - sourceOptionsModel.siteCollections(), java.util.Arrays.asList(sourceOptionsSiteCollModel)); - assertEquals(sourceOptionsModel.urls(), java.util.Arrays.asList(sourceOptionsWebCrawlModel)); - assertEquals(sourceOptionsModel.buckets(), java.util.Arrays.asList(sourceOptionsBucketsModel)); - assertEquals(sourceOptionsModel.crawlAllBuckets(), Boolean.valueOf(true)); - - Source sourceModel = - new Source.Builder() - .type("box") - .credentialId("testString") - .schedule(sourceScheduleModel) - .options(sourceOptionsModel) - .build(); - assertEquals(sourceModel.type(), "box"); - assertEquals(sourceModel.credentialId(), "testString"); - assertEquals(sourceModel.schedule(), sourceScheduleModel); - assertEquals(sourceModel.options(), sourceOptionsModel); - - String json = TestUtilities.serialize(sourceModel); - - Source sourceModelNew = TestUtilities.deserialize(json, Source.class); - assertTrue(sourceModelNew instanceof Source); - assertEquals(sourceModelNew.type(), "box"); - assertEquals(sourceModelNew.credentialId(), "testString"); - assertEquals(sourceModelNew.schedule().toString(), sourceScheduleModel.toString()); - assertEquals(sourceModelNew.options().toString(), sourceOptionsModel.toString()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/StatusDetailsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/StatusDetailsTest.java deleted file mode 100644 index 8f811af355c..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/StatusDetailsTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the StatusDetails model. */ -public class StatusDetailsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testStatusDetails() throws Throwable { - StatusDetails statusDetailsModel = - new StatusDetails.Builder().authenticated(true).errorMessage("testString").build(); - assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true)); - assertEquals(statusDetailsModel.errorMessage(), "testString"); - - String json = TestUtilities.serialize(statusDetailsModel); - - StatusDetails statusDetailsModelNew = TestUtilities.deserialize(json, StatusDetails.class); - assertTrue(statusDetailsModelNew instanceof StatusDetails); - assertEquals(statusDetailsModelNew.authenticated(), Boolean.valueOf(true)); - assertEquals(statusDetailsModelNew.errorMessage(), "testString"); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TokenDictRuleTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TokenDictRuleTest.java deleted file mode 100644 index 882706f1931..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TokenDictRuleTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TokenDictRule model. */ -public class TokenDictRuleTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTokenDictRule() throws Throwable { - TokenDictRule tokenDictRuleModel = - new TokenDictRule.Builder() - .text("testString") - .tokens(java.util.Arrays.asList("testString")) - .readings(java.util.Arrays.asList("testString")) - .partOfSpeech("testString") - .build(); - assertEquals(tokenDictRuleModel.text(), "testString"); - assertEquals(tokenDictRuleModel.tokens(), java.util.Arrays.asList("testString")); - assertEquals(tokenDictRuleModel.readings(), java.util.Arrays.asList("testString")); - assertEquals(tokenDictRuleModel.partOfSpeech(), "testString"); - - String json = TestUtilities.serialize(tokenDictRuleModel); - - TokenDictRule tokenDictRuleModelNew = TestUtilities.deserialize(json, TokenDictRule.class); - assertTrue(tokenDictRuleModelNew instanceof TokenDictRule); - assertEquals(tokenDictRuleModelNew.text(), "testString"); - assertEquals(tokenDictRuleModelNew.partOfSpeech(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTokenDictRuleError() throws Throwable { - new TokenDictRule.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TokenDictStatusResponseTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TokenDictStatusResponseTest.java deleted file mode 100644 index 7243225b393..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TokenDictStatusResponseTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TokenDictStatusResponse model. */ -public class TokenDictStatusResponseTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTokenDictStatusResponse() throws Throwable { - TokenDictStatusResponse tokenDictStatusResponseModel = new TokenDictStatusResponse(); - assertNull(tokenDictStatusResponseModel.getStatus()); - assertNull(tokenDictStatusResponseModel.getType()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TopHitsResultsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TopHitsResultsTest.java deleted file mode 100644 index 7495172a3af..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TopHitsResultsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TopHitsResults model. */ -public class TopHitsResultsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTopHitsResults() throws Throwable { - TopHitsResults topHitsResultsModel = new TopHitsResults(); - assertNull(topHitsResultsModel.getMatchingResults()); - assertNull(topHitsResultsModel.getHits()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingDataSetTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingDataSetTest.java deleted file mode 100644 index e21cbe3bff3..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingDataSetTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TrainingDataSet model. */ -public class TrainingDataSetTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTrainingDataSet() throws Throwable { - TrainingDataSet trainingDataSetModel = new TrainingDataSet(); - assertNull(trainingDataSetModel.getEnvironmentId()); - assertNull(trainingDataSetModel.getCollectionId()); - assertNull(trainingDataSetModel.getQueries()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingExampleListTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingExampleListTest.java deleted file mode 100644 index 6ac589a45d8..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingExampleListTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TrainingExampleList model. */ -public class TrainingExampleListTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTrainingExampleList() throws Throwable { - TrainingExampleList trainingExampleListModel = new TrainingExampleList(); - assertNull(trainingExampleListModel.getExamples()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingExampleTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingExampleTest.java deleted file mode 100644 index bf6456ad7dc..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingExampleTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TrainingExample model. */ -public class TrainingExampleTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTrainingExample() throws Throwable { - TrainingExample trainingExampleModel = - new TrainingExample.Builder() - .documentId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - assertEquals(trainingExampleModel.documentId(), "testString"); - assertEquals(trainingExampleModel.crossReference(), "testString"); - assertEquals(trainingExampleModel.relevance(), Long.valueOf("26")); - - String json = TestUtilities.serialize(trainingExampleModel); - - TrainingExample trainingExampleModelNew = - TestUtilities.deserialize(json, TrainingExample.class); - assertTrue(trainingExampleModelNew instanceof TrainingExample); - assertEquals(trainingExampleModelNew.documentId(), "testString"); - assertEquals(trainingExampleModelNew.crossReference(), "testString"); - assertEquals(trainingExampleModelNew.relevance(), Long.valueOf("26")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingQueryTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingQueryTest.java deleted file mode 100644 index 231000a0d3a..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingQueryTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TrainingQuery model. */ -public class TrainingQueryTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTrainingQuery() throws Throwable { - TrainingQuery trainingQueryModel = new TrainingQuery(); - assertNull(trainingQueryModel.getQueryId()); - assertNull(trainingQueryModel.getNaturalLanguageQuery()); - assertNull(trainingQueryModel.getFilter()); - assertNull(trainingQueryModel.getExamples()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingStatusTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingStatusTest.java deleted file mode 100644 index e21cb3199b3..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/TrainingStatusTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TrainingStatus model. */ -public class TrainingStatusTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTrainingStatus() throws Throwable { - TrainingStatus trainingStatusModel = new TrainingStatus(); - assertNull(trainingStatusModel.getTotalExamples()); - assertNull(trainingStatusModel.isAvailable()); - assertNull(trainingStatusModel.isProcessing()); - assertNull(trainingStatusModel.isMinimumQueriesAdded()); - assertNull(trainingStatusModel.isMinimumExamplesAdded()); - assertNull(trainingStatusModel.isSufficientLabelDiversity()); - assertNull(trainingStatusModel.getNotices()); - assertNull(trainingStatusModel.getSuccessfullyTrained()); - assertNull(trainingStatusModel.getDataUpdated()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCollectionOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCollectionOptionsTest.java deleted file mode 100644 index 8c3e814df61..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCollectionOptionsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the UpdateCollectionOptions model. */ -public class UpdateCollectionOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateCollectionOptions() throws Throwable { - UpdateCollectionOptions updateCollectionOptionsModel = - new UpdateCollectionOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .name("testString") - .description("testString") - .configurationId("testString") - .build(); - assertEquals(updateCollectionOptionsModel.environmentId(), "testString"); - assertEquals(updateCollectionOptionsModel.collectionId(), "testString"); - assertEquals(updateCollectionOptionsModel.name(), "testString"); - assertEquals(updateCollectionOptionsModel.description(), "testString"); - assertEquals(updateCollectionOptionsModel.configurationId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateCollectionOptionsError() throws Throwable { - new UpdateCollectionOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateConfigurationOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateConfigurationOptionsTest.java deleted file mode 100644 index e9b78a414bd..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateConfigurationOptionsTest.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the UpdateConfigurationOptions model. */ -public class UpdateConfigurationOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateConfigurationOptions() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - PdfHeadingDetection pdfHeadingDetectionModel = - new PdfHeadingDetection.Builder().fonts(java.util.Arrays.asList(fontSettingModel)).build(); - assertEquals(pdfHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - - PdfSettings pdfSettingsModel = - new PdfSettings.Builder().heading(pdfHeadingDetectionModel).build(); - assertEquals(pdfSettingsModel.heading(), pdfHeadingDetectionModel); - - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - assertEquals(wordHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - assertEquals(wordHeadingDetectionModel.styles(), java.util.Arrays.asList(wordStyleModel)); - - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - assertEquals(wordSettingsModel.heading(), wordHeadingDetectionModel); - - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - assertEquals(xPathPatternsModel.xpaths(), java.util.Arrays.asList("testString")); - - HtmlSettings htmlSettingsModel = - new HtmlSettings.Builder() - .excludeTagsCompletely(java.util.Arrays.asList("testString")) - .excludeTagsKeepContent(java.util.Arrays.asList("testString")) - .keepContent(xPathPatternsModel) - .excludeContent(xPathPatternsModel) - .keepTagAttributes(java.util.Arrays.asList("testString")) - .excludeTagAttributes(java.util.Arrays.asList("testString")) - .build(); - assertEquals(htmlSettingsModel.excludeTagsCompletely(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagsKeepContent(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.keepContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.excludeContent(), xPathPatternsModel); - assertEquals(htmlSettingsModel.keepTagAttributes(), java.util.Arrays.asList("testString")); - assertEquals(htmlSettingsModel.excludeTagAttributes(), java.util.Arrays.asList("testString")); - - SegmentSettings segmentSettingsModel = - new SegmentSettings.Builder() - .enabled(false) - .selectorTags(java.util.Arrays.asList("h1", "h2")) - .annotatedFields(java.util.Arrays.asList("testString")) - .build(); - assertEquals(segmentSettingsModel.enabled(), Boolean.valueOf(false)); - assertEquals(segmentSettingsModel.selectorTags(), java.util.Arrays.asList("h1", "h2")); - assertEquals(segmentSettingsModel.annotatedFields(), java.util.Arrays.asList("testString")); - - NormalizationOperation normalizationOperationModel = - new NormalizationOperation.Builder() - .operation("copy") - .sourceField("testString") - .destinationField("testString") - .build(); - assertEquals(normalizationOperationModel.operation(), "copy"); - assertEquals(normalizationOperationModel.sourceField(), "testString"); - assertEquals(normalizationOperationModel.destinationField(), "testString"); - - Conversions conversionsModel = - new Conversions.Builder() - .pdf(pdfSettingsModel) - .word(wordSettingsModel) - .html(htmlSettingsModel) - .segment(segmentSettingsModel) - .jsonNormalizations(java.util.Arrays.asList(normalizationOperationModel)) - .imageTextRecognition(true) - .build(); - assertEquals(conversionsModel.pdf(), pdfSettingsModel); - assertEquals(conversionsModel.word(), wordSettingsModel); - assertEquals(conversionsModel.html(), htmlSettingsModel); - assertEquals(conversionsModel.segment(), segmentSettingsModel); - assertEquals( - conversionsModel.jsonNormalizations(), - java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(conversionsModel.imageTextRecognition(), Boolean.valueOf(true)); - - NluEnrichmentKeywords nluEnrichmentKeywordsModel = - new NluEnrichmentKeywords.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentKeywordsModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentKeywordsModel.limit(), Long.valueOf("26")); - - NluEnrichmentEntities nluEnrichmentEntitiesModel = - new NluEnrichmentEntities.Builder() - .sentiment(true) - .emotion(true) - .limit(Long.valueOf("26")) - .mentions(true) - .mentionTypes(true) - .sentenceLocations(true) - .model("testString") - .build(); - assertEquals(nluEnrichmentEntitiesModel.sentiment(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.emotion(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.limit(), Long.valueOf("26")); - assertEquals(nluEnrichmentEntitiesModel.mentions(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.mentionTypes(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.sentenceLocations(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEntitiesModel.model(), "testString"); - - NluEnrichmentSentiment nluEnrichmentSentimentModel = - new NluEnrichmentSentiment.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentSentimentModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSentimentModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentEmotion nluEnrichmentEmotionModel = - new NluEnrichmentEmotion.Builder() - .document(true) - .targets(java.util.Arrays.asList("testString")) - .build(); - assertEquals(nluEnrichmentEmotionModel.document(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentEmotionModel.targets(), java.util.Arrays.asList("testString")); - - NluEnrichmentSemanticRoles nluEnrichmentSemanticRolesModel = - new NluEnrichmentSemanticRoles.Builder() - .entities(true) - .keywords(true) - .limit(Long.valueOf("26")) - .build(); - assertEquals(nluEnrichmentSemanticRolesModel.entities(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.keywords(), Boolean.valueOf(true)); - assertEquals(nluEnrichmentSemanticRolesModel.limit(), Long.valueOf("26")); - - NluEnrichmentRelations nluEnrichmentRelationsModel = - new NluEnrichmentRelations.Builder().model("testString").build(); - assertEquals(nluEnrichmentRelationsModel.model(), "testString"); - - NluEnrichmentConcepts nluEnrichmentConceptsModel = - new NluEnrichmentConcepts.Builder().limit(Long.valueOf("26")).build(); - assertEquals(nluEnrichmentConceptsModel.limit(), Long.valueOf("26")); - - NluEnrichmentFeatures nluEnrichmentFeaturesModel = - new NluEnrichmentFeatures.Builder() - .keywords(nluEnrichmentKeywordsModel) - .entities(nluEnrichmentEntitiesModel) - .sentiment(nluEnrichmentSentimentModel) - .emotion(nluEnrichmentEmotionModel) - .categories(java.util.Collections.singletonMap("anyKey", "anyValue")) - .semanticRoles(nluEnrichmentSemanticRolesModel) - .relations(nluEnrichmentRelationsModel) - .concepts(nluEnrichmentConceptsModel) - .build(); - assertEquals(nluEnrichmentFeaturesModel.keywords(), nluEnrichmentKeywordsModel); - assertEquals(nluEnrichmentFeaturesModel.entities(), nluEnrichmentEntitiesModel); - assertEquals(nluEnrichmentFeaturesModel.sentiment(), nluEnrichmentSentimentModel); - assertEquals(nluEnrichmentFeaturesModel.emotion(), nluEnrichmentEmotionModel); - assertEquals( - nluEnrichmentFeaturesModel.categories(), - java.util.Collections.singletonMap("anyKey", "anyValue")); - assertEquals(nluEnrichmentFeaturesModel.semanticRoles(), nluEnrichmentSemanticRolesModel); - assertEquals(nluEnrichmentFeaturesModel.relations(), nluEnrichmentRelationsModel); - assertEquals(nluEnrichmentFeaturesModel.concepts(), nluEnrichmentConceptsModel); - - EnrichmentOptions enrichmentOptionsModel = - new EnrichmentOptions.Builder() - .features(nluEnrichmentFeaturesModel) - .language("ar") - .model("testString") - .build(); - assertEquals(enrichmentOptionsModel.features(), nluEnrichmentFeaturesModel); - assertEquals(enrichmentOptionsModel.language(), "ar"); - assertEquals(enrichmentOptionsModel.model(), "testString"); - - Enrichment enrichmentModel = - new Enrichment.Builder() - .description("testString") - .destinationField("testString") - .sourceField("testString") - .overwrite(false) - .enrichment("testString") - .ignoreDownstreamErrors(false) - .options(enrichmentOptionsModel) - .build(); - assertEquals(enrichmentModel.description(), "testString"); - assertEquals(enrichmentModel.destinationField(), "testString"); - assertEquals(enrichmentModel.sourceField(), "testString"); - assertEquals(enrichmentModel.overwrite(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.enrichment(), "testString"); - assertEquals(enrichmentModel.ignoreDownstreamErrors(), Boolean.valueOf(false)); - assertEquals(enrichmentModel.options(), enrichmentOptionsModel); - - SourceSchedule sourceScheduleModel = - new SourceSchedule.Builder() - .enabled(true) - .timeZone("America/New_York") - .frequency("daily") - .build(); - assertEquals(sourceScheduleModel.enabled(), Boolean.valueOf(true)); - assertEquals(sourceScheduleModel.timeZone(), "America/New_York"); - assertEquals(sourceScheduleModel.frequency(), "daily"); - - SourceOptionsFolder sourceOptionsFolderModel = - new SourceOptionsFolder.Builder() - .ownerUserId("testString") - .folderId("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsFolderModel.ownerUserId(), "testString"); - assertEquals(sourceOptionsFolderModel.folderId(), "testString"); - assertEquals(sourceOptionsFolderModel.limit(), Long.valueOf("26")); - - SourceOptionsObject sourceOptionsObjectModel = - new SourceOptionsObject.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsObjectModel.name(), "testString"); - assertEquals(sourceOptionsObjectModel.limit(), Long.valueOf("26")); - - SourceOptionsSiteColl sourceOptionsSiteCollModel = - new SourceOptionsSiteColl.Builder() - .siteCollectionPath("testString") - .limit(Long.valueOf("26")) - .build(); - assertEquals(sourceOptionsSiteCollModel.siteCollectionPath(), "testString"); - assertEquals(sourceOptionsSiteCollModel.limit(), Long.valueOf("26")); - - SourceOptionsWebCrawl sourceOptionsWebCrawlModel = - new SourceOptionsWebCrawl.Builder() - .url("testString") - .limitToStartingHosts(true) - .crawlSpeed("normal") - .allowUntrustedCertificate(false) - .maximumHops(Long.valueOf("2")) - .requestTimeout(Long.valueOf("30000")) - .overrideRobotsTxt(false) - .blacklist(java.util.Arrays.asList("testString")) - .build(); - assertEquals(sourceOptionsWebCrawlModel.url(), "testString"); - assertEquals(sourceOptionsWebCrawlModel.limitToStartingHosts(), Boolean.valueOf(true)); - assertEquals(sourceOptionsWebCrawlModel.crawlSpeed(), "normal"); - assertEquals(sourceOptionsWebCrawlModel.allowUntrustedCertificate(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.maximumHops(), Long.valueOf("2")); - assertEquals(sourceOptionsWebCrawlModel.requestTimeout(), Long.valueOf("30000")); - assertEquals(sourceOptionsWebCrawlModel.overrideRobotsTxt(), Boolean.valueOf(false)); - assertEquals(sourceOptionsWebCrawlModel.blacklist(), java.util.Arrays.asList("testString")); - - SourceOptionsBuckets sourceOptionsBucketsModel = - new SourceOptionsBuckets.Builder().name("testString").limit(Long.valueOf("26")).build(); - assertEquals(sourceOptionsBucketsModel.name(), "testString"); - assertEquals(sourceOptionsBucketsModel.limit(), Long.valueOf("26")); - - SourceOptions sourceOptionsModel = - new SourceOptions.Builder() - .folders(java.util.Arrays.asList(sourceOptionsFolderModel)) - .objects(java.util.Arrays.asList(sourceOptionsObjectModel)) - .siteCollections(java.util.Arrays.asList(sourceOptionsSiteCollModel)) - .urls(java.util.Arrays.asList(sourceOptionsWebCrawlModel)) - .buckets(java.util.Arrays.asList(sourceOptionsBucketsModel)) - .crawlAllBuckets(true) - .build(); - assertEquals(sourceOptionsModel.folders(), java.util.Arrays.asList(sourceOptionsFolderModel)); - assertEquals(sourceOptionsModel.objects(), java.util.Arrays.asList(sourceOptionsObjectModel)); - assertEquals( - sourceOptionsModel.siteCollections(), java.util.Arrays.asList(sourceOptionsSiteCollModel)); - assertEquals(sourceOptionsModel.urls(), java.util.Arrays.asList(sourceOptionsWebCrawlModel)); - assertEquals(sourceOptionsModel.buckets(), java.util.Arrays.asList(sourceOptionsBucketsModel)); - assertEquals(sourceOptionsModel.crawlAllBuckets(), Boolean.valueOf(true)); - - Source sourceModel = - new Source.Builder() - .type("box") - .credentialId("testString") - .schedule(sourceScheduleModel) - .options(sourceOptionsModel) - .build(); - assertEquals(sourceModel.type(), "box"); - assertEquals(sourceModel.credentialId(), "testString"); - assertEquals(sourceModel.schedule(), sourceScheduleModel); - assertEquals(sourceModel.options(), sourceOptionsModel); - - UpdateConfigurationOptions updateConfigurationOptionsModel = - new UpdateConfigurationOptions.Builder() - .environmentId("testString") - .configurationId("testString") - .name("testString") - .description("testString") - .conversions(conversionsModel) - .enrichments(java.util.Arrays.asList(enrichmentModel)) - .normalizations(java.util.Arrays.asList(normalizationOperationModel)) - .source(sourceModel) - .build(); - assertEquals(updateConfigurationOptionsModel.environmentId(), "testString"); - assertEquals(updateConfigurationOptionsModel.configurationId(), "testString"); - assertEquals(updateConfigurationOptionsModel.name(), "testString"); - assertEquals(updateConfigurationOptionsModel.description(), "testString"); - assertEquals(updateConfigurationOptionsModel.conversions(), conversionsModel); - assertEquals( - updateConfigurationOptionsModel.enrichments(), java.util.Arrays.asList(enrichmentModel)); - assertEquals( - updateConfigurationOptionsModel.normalizations(), - java.util.Arrays.asList(normalizationOperationModel)); - assertEquals(updateConfigurationOptionsModel.source(), sourceModel); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateConfigurationOptionsError() throws Throwable { - new UpdateConfigurationOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptionsTest.java deleted file mode 100644 index ec223048a90..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateCredentialsOptionsTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2021. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the UpdateCredentialsOptions model. */ -public class UpdateCredentialsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateCredentialsOptions() throws Throwable { - CredentialDetails credentialDetailsModel = - new CredentialDetails.Builder() - .credentialType("oauth2") - .clientId("testString") - .enterpriseId("testString") - .url("testString") - .username("testString") - .organizationUrl("testString") - .siteCollectionPath("testString") - .clientSecret("testString") - .publicKeyId("testString") - .privateKey("testString") - .passphrase("testString") - .password("testString") - .gatewayId("testString") - .sourceVersion("online") - .webApplicationUrl("testString") - .domain("testString") - .endpoint("testString") - .accessKeyId("testString") - .secretAccessKey("testString") - .build(); - assertEquals(credentialDetailsModel.credentialType(), "oauth2"); - assertEquals(credentialDetailsModel.clientId(), "testString"); - assertEquals(credentialDetailsModel.enterpriseId(), "testString"); - assertEquals(credentialDetailsModel.url(), "testString"); - assertEquals(credentialDetailsModel.username(), "testString"); - assertEquals(credentialDetailsModel.organizationUrl(), "testString"); - assertEquals(credentialDetailsModel.siteCollectionPath(), "testString"); - assertEquals(credentialDetailsModel.clientSecret(), "testString"); - assertEquals(credentialDetailsModel.publicKeyId(), "testString"); - assertEquals(credentialDetailsModel.privateKey(), "testString"); - assertEquals(credentialDetailsModel.passphrase(), "testString"); - assertEquals(credentialDetailsModel.password(), "testString"); - assertEquals(credentialDetailsModel.gatewayId(), "testString"); - assertEquals(credentialDetailsModel.sourceVersion(), "online"); - assertEquals(credentialDetailsModel.webApplicationUrl(), "testString"); - assertEquals(credentialDetailsModel.domain(), "testString"); - assertEquals(credentialDetailsModel.endpoint(), "testString"); - assertEquals(credentialDetailsModel.accessKeyId(), "testString"); - assertEquals(credentialDetailsModel.secretAccessKey(), "testString"); - - StatusDetails statusDetailsModel = - new StatusDetails.Builder().authenticated(true).errorMessage("testString").build(); - assertEquals(statusDetailsModel.authenticated(), Boolean.valueOf(true)); - assertEquals(statusDetailsModel.errorMessage(), "testString"); - - UpdateCredentialsOptions updateCredentialsOptionsModel = - new UpdateCredentialsOptions.Builder() - .environmentId("testString") - .credentialId("testString") - .sourceType("box") - .credentialDetails(credentialDetailsModel) - .status(statusDetailsModel) - .build(); - assertEquals(updateCredentialsOptionsModel.environmentId(), "testString"); - assertEquals(updateCredentialsOptionsModel.credentialId(), "testString"); - assertEquals(updateCredentialsOptionsModel.sourceType(), "box"); - assertEquals(updateCredentialsOptionsModel.credentialDetails(), credentialDetailsModel); - assertEquals(updateCredentialsOptionsModel.status(), statusDetailsModel); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateCredentialsOptionsError() throws Throwable { - new UpdateCredentialsOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateDocumentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateDocumentOptionsTest.java deleted file mode 100644 index 0f5bcbbc4e8..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateDocumentOptionsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.apache.commons.io.IOUtils; -import org.testng.annotations.Test; - -/** Unit test class for the UpdateDocumentOptions model. */ -public class UpdateDocumentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateDocumentOptions() throws Throwable { - UpdateDocumentOptions updateDocumentOptionsModel = - new UpdateDocumentOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .documentId("testString") - .file(TestUtilities.createMockStream("This is a mock file.")) - .filename("testString") - .fileContentType("application/json") - .metadata("testString") - .build(); - assertEquals(updateDocumentOptionsModel.environmentId(), "testString"); - assertEquals(updateDocumentOptionsModel.collectionId(), "testString"); - assertEquals(updateDocumentOptionsModel.documentId(), "testString"); - assertEquals( - IOUtils.toString(updateDocumentOptionsModel.file()), - IOUtils.toString(TestUtilities.createMockStream("This is a mock file."))); - assertEquals(updateDocumentOptionsModel.filename(), "testString"); - assertEquals(updateDocumentOptionsModel.fileContentType(), "application/json"); - assertEquals(updateDocumentOptionsModel.metadata(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateDocumentOptionsError() throws Throwable { - new UpdateDocumentOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateEnvironmentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateEnvironmentOptionsTest.java deleted file mode 100644 index b13b98c389b..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateEnvironmentOptionsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the UpdateEnvironmentOptions model. */ -public class UpdateEnvironmentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateEnvironmentOptions() throws Throwable { - UpdateEnvironmentOptions updateEnvironmentOptionsModel = - new UpdateEnvironmentOptions.Builder() - .environmentId("testString") - .name("testString") - .description("testString") - .size("S") - .build(); - assertEquals(updateEnvironmentOptionsModel.environmentId(), "testString"); - assertEquals(updateEnvironmentOptionsModel.name(), "testString"); - assertEquals(updateEnvironmentOptionsModel.description(), "testString"); - assertEquals(updateEnvironmentOptionsModel.size(), "S"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateEnvironmentOptionsError() throws Throwable { - new UpdateEnvironmentOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateTrainingExampleOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateTrainingExampleOptionsTest.java deleted file mode 100644 index 9b847e2bc8c..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/UpdateTrainingExampleOptionsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the UpdateTrainingExampleOptions model. */ -public class UpdateTrainingExampleOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testUpdateTrainingExampleOptions() throws Throwable { - UpdateTrainingExampleOptions updateTrainingExampleOptionsModel = - new UpdateTrainingExampleOptions.Builder() - .environmentId("testString") - .collectionId("testString") - .queryId("testString") - .exampleId("testString") - .crossReference("testString") - .relevance(Long.valueOf("26")) - .build(); - assertEquals(updateTrainingExampleOptionsModel.environmentId(), "testString"); - assertEquals(updateTrainingExampleOptionsModel.collectionId(), "testString"); - assertEquals(updateTrainingExampleOptionsModel.queryId(), "testString"); - assertEquals(updateTrainingExampleOptionsModel.exampleId(), "testString"); - assertEquals(updateTrainingExampleOptionsModel.crossReference(), "testString"); - assertEquals(updateTrainingExampleOptionsModel.relevance(), Long.valueOf("26")); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testUpdateTrainingExampleOptionsError() throws Throwable { - new UpdateTrainingExampleOptions.Builder().build(); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordHeadingDetectionTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordHeadingDetectionTest.java deleted file mode 100644 index aa22536e859..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordHeadingDetectionTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the WordHeadingDetection model. */ -public class WordHeadingDetectionTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testWordHeadingDetection() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - assertEquals(wordHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - assertEquals(wordHeadingDetectionModel.styles(), java.util.Arrays.asList(wordStyleModel)); - - String json = TestUtilities.serialize(wordHeadingDetectionModel); - - WordHeadingDetection wordHeadingDetectionModelNew = - TestUtilities.deserialize(json, WordHeadingDetection.class); - assertTrue(wordHeadingDetectionModelNew instanceof WordHeadingDetection); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordSettingsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordSettingsTest.java deleted file mode 100644 index 6a247ada835..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordSettingsTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the WordSettings model. */ -public class WordSettingsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testWordSettings() throws Throwable { - FontSetting fontSettingModel = - new FontSetting.Builder() - .level(Long.valueOf("26")) - .minSize(Long.valueOf("26")) - .maxSize(Long.valueOf("26")) - .bold(true) - .italic(true) - .name("testString") - .build(); - assertEquals(fontSettingModel.level(), Long.valueOf("26")); - assertEquals(fontSettingModel.minSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.maxSize(), Long.valueOf("26")); - assertEquals(fontSettingModel.bold(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.italic(), Boolean.valueOf(true)); - assertEquals(fontSettingModel.name(), "testString"); - - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - WordHeadingDetection wordHeadingDetectionModel = - new WordHeadingDetection.Builder() - .fonts(java.util.Arrays.asList(fontSettingModel)) - .styles(java.util.Arrays.asList(wordStyleModel)) - .build(); - assertEquals(wordHeadingDetectionModel.fonts(), java.util.Arrays.asList(fontSettingModel)); - assertEquals(wordHeadingDetectionModel.styles(), java.util.Arrays.asList(wordStyleModel)); - - WordSettings wordSettingsModel = - new WordSettings.Builder().heading(wordHeadingDetectionModel).build(); - assertEquals(wordSettingsModel.heading(), wordHeadingDetectionModel); - - String json = TestUtilities.serialize(wordSettingsModel); - - WordSettings wordSettingsModelNew = TestUtilities.deserialize(json, WordSettings.class); - assertTrue(wordSettingsModelNew instanceof WordSettings); - assertEquals(wordSettingsModelNew.heading().toString(), wordHeadingDetectionModel.toString()); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordStyleTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordStyleTest.java deleted file mode 100644 index f46738e9f70..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/WordStyleTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the WordStyle model. */ -public class WordStyleTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testWordStyle() throws Throwable { - WordStyle wordStyleModel = - new WordStyle.Builder() - .level(Long.valueOf("26")) - .names(java.util.Arrays.asList("testString")) - .build(); - assertEquals(wordStyleModel.level(), Long.valueOf("26")); - assertEquals(wordStyleModel.names(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(wordStyleModel); - - WordStyle wordStyleModelNew = TestUtilities.deserialize(json, WordStyle.class); - assertTrue(wordStyleModelNew instanceof WordStyle); - assertEquals(wordStyleModelNew.level(), Long.valueOf("26")); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/XPathPatternsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/model/XPathPatternsTest.java deleted file mode 100644 index d852fc20145..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/XPathPatternsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.discovery.v1.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the XPathPatterns model. */ -public class XPathPatternsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testXPathPatterns() throws Throwable { - XPathPatterns xPathPatternsModel = - new XPathPatterns.Builder().xpaths(java.util.Arrays.asList("testString")).build(); - assertEquals(xPathPatternsModel.xpaths(), java.util.Arrays.asList("testString")); - - String json = TestUtilities.serialize(xPathPatternsModel); - - XPathPatterns xPathPatternsModelNew = TestUtilities.deserialize(json, XPathPatterns.class); - assertTrue(xPathPatternsModelNew instanceof XPathPatterns); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/testng.xml b/discovery/src/test/java/com/ibm/watson/discovery/v1/testng.xml deleted file mode 100644 index 59beff01620..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/testng.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/utils/TestUtilities.java b/discovery/src/test/java/com/ibm/watson/discovery/v1/utils/TestUtilities.java deleted file mode 100644 index a944fd256d4..00000000000 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/utils/TestUtilities.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.discovery.v1.utils; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.cloud.sdk.core.util.GsonSingleton; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import okhttp3.HttpUrl; -import okhttp3.mockwebserver.RecordedRequest; - -/** A class used by the unit tests containing utility functions. */ -public class TestUtilities { - public static Map createMockMap() { - Map mockMap = new HashMap<>(); - mockMap.put("foo", "bar"); - return mockMap; - } - - public static HashMap createMockStreamMap() { - return new HashMap() { - { - put("key1", createMockStream("This is a mock file.")); - } - }; - } - - public static Map parseQueryString(RecordedRequest req) { - Map queryMap = new HashMap<>(); - - try { - HttpUrl requestUrl = req.getRequestUrl(); - - if (requestUrl != null) { - Set queryParamsNames = requestUrl.queryParameterNames(); - // map the parameter name to its corresponding value - for (String p : queryParamsNames) { - // get the corresponding value for the parameter (p) - List val = requestUrl.queryParameterValues(p); - if (val != null && !val.isEmpty()) { - String joinedQuery = String.join(",", val); - queryMap.put(p, joinedQuery); - } - } - } - if (queryMap.isEmpty()) { - return null; - } - } catch (Exception e) { - return null; - } - - return queryMap; - } - - public static String parseReqPath(RecordedRequest req) { - String parsedPath = null; - - try { - String fullPath = req.getPath(); - if (fullPath != null && !fullPath.isEmpty()) { - // retrieve the path segment before the query parameter - parsedPath = fullPath.split("\\?", 2)[0]; - } - if (parsedPath.isEmpty() || parsedPath == null) { - return null; - } - - } catch (Exception e) { - return null; - } - - return parsedPath; - } - - public static String serialize(Object obj) { - return GsonSingleton.getGson().toJson(obj); - } - - public static T deserialize(String json, Class clazz) { - return GsonSingleton.getGson().fromJson(json, clazz); - } - - public static InputStream createMockStream(String s) { - return new ByteArrayInputStream(s.getBytes()); - } - - public static List creatMockListFileWithMetadata() { - List list = new ArrayList(); - byte[] fileBytes = {(byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef}; - InputStream inputStream = new ByteArrayInputStream(fileBytes); - FileWithMetadata.Builder builder = new FileWithMetadata.Builder(); - builder.data(inputStream); - FileWithMetadata fileWithMetadata = builder.build(); - list.add(fileWithMetadata); - - return list; - } - - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); - } - - public static Date createMockDate(String date) throws Exception { - return DateUtils.parseAsDate(date); - } - - public static Date createMockDateTime(String date) throws Exception { - return DateUtils.parseAsDateTime(date); - } -} diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v2/DiscoveryTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/DiscoveryTest.java index 9169adb7145..f244f670ade 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v2/DiscoveryTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/DiscoveryTest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2; import static org.testng.Assert.*; @@ -75,6 +76,8 @@ import com.ibm.watson.discovery.v2.model.GetProjectOptions; import com.ibm.watson.discovery.v2.model.GetStopwordListOptions; import com.ibm.watson.discovery.v2.model.GetTrainingQueryOptions; +import com.ibm.watson.discovery.v2.model.ListBatchesOptions; +import com.ibm.watson.discovery.v2.model.ListBatchesResponse; import com.ibm.watson.discovery.v2.model.ListCollectionsOptions; import com.ibm.watson.discovery.v2.model.ListCollectionsResponse; import com.ibm.watson.discovery.v2.model.ListDocumentClassifierModelsOptions; @@ -89,6 +92,9 @@ import com.ibm.watson.discovery.v2.model.ListProjectsResponse; import com.ibm.watson.discovery.v2.model.ListTrainingQueriesOptions; import com.ibm.watson.discovery.v2.model.ProjectDetails; +import com.ibm.watson.discovery.v2.model.PullBatchesOptions; +import com.ibm.watson.discovery.v2.model.PullBatchesResponse; +import com.ibm.watson.discovery.v2.model.PushBatchesOptions; import com.ibm.watson.discovery.v2.model.QueryCollectionNoticesOptions; import com.ibm.watson.discovery.v2.model.QueryLargePassages; import com.ibm.watson.discovery.v2.model.QueryLargeSimilar; @@ -2462,6 +2468,175 @@ public void testDeleteEnrichmentNoOptions() throws Throwable { discoveryService.deleteEnrichment(null).execute(); } + // Test the listBatches operation with a valid options model parameter + @Test + public void testListBatchesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = + "{\"batches\": [{\"batch_id\": \"batchId\", \"created\": \"2019-01-01T12:00:00.000Z\", \"enrichment_id\": \"enrichmentId\"}]}"; + String listBatchesPath = "/v2/projects/testString/collections/testString/batches"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the ListBatchesOptions model + ListBatchesOptions listBatchesOptionsModel = + new ListBatchesOptions.Builder().projectId("testString").collectionId("testString").build(); + + // Invoke listBatches() with a valid options model and verify the result + Response response = + discoveryService.listBatches(listBatchesOptionsModel).execute(); + assertNotNull(response); + ListBatchesResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, listBatchesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the listBatches operation with and without retries enabled + @Test + public void testListBatchesWRetries() throws Throwable { + discoveryService.enableRetries(4, 30); + testListBatchesWOptions(); + + discoveryService.disableRetries(); + testListBatchesWOptions(); + } + + // Test the listBatches operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testListBatchesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + discoveryService.listBatches(null).execute(); + } + + // Test the pullBatches operation with a valid options model parameter + @Test + public void testPullBatchesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "{\"file\": \"file\"}"; + String pullBatchesPath = "/v2/projects/testString/collections/testString/batches/testString"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(200) + .setBody(mockResponseBody)); + + // Construct an instance of the PullBatchesOptions model + PullBatchesOptions pullBatchesOptionsModel = + new PullBatchesOptions.Builder() + .projectId("testString") + .collectionId("testString") + .batchId("testString") + .build(); + + // Invoke pullBatches() with a valid options model and verify the result + Response response = + discoveryService.pullBatches(pullBatchesOptionsModel).execute(); + assertNotNull(response); + PullBatchesResponse responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "GET"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, pullBatchesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the pullBatches operation with and without retries enabled + @Test + public void testPullBatchesWRetries() throws Throwable { + discoveryService.enableRetries(4, 30); + testPullBatchesWOptions(); + + discoveryService.disableRetries(); + testPullBatchesWOptions(); + } + + // Test the pullBatches operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testPullBatchesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + discoveryService.pullBatches(null).execute(); + } + + // Test the pushBatches operation with a valid options model parameter + @Test + public void testPushBatchesWOptions() throws Throwable { + // Register a mock response + String mockResponseBody = "false"; + String pushBatchesPath = "/v2/projects/testString/collections/testString/batches/testString"; + server.enqueue( + new MockResponse() + .setHeader("Content-type", "application/json") + .setResponseCode(202) + .setBody(mockResponseBody)); + + // Construct an instance of the PushBatchesOptions model + PushBatchesOptions pushBatchesOptionsModel = + new PushBatchesOptions.Builder() + .projectId("testString") + .collectionId("testString") + .batchId("testString") + .file(TestUtilities.createMockStream("This is a mock file.")) + .filename("testString") + .build(); + + // Invoke pushBatches() with a valid options model and verify the result + Response response = discoveryService.pushBatches(pushBatchesOptionsModel).execute(); + assertNotNull(response); + Boolean responseObj = response.getResult(); + assertNotNull(responseObj); + + // Verify the contents of the request sent to the mock server + RecordedRequest request = server.takeRequest(); + assertNotNull(request); + assertEquals(request.getMethod(), "POST"); + // Verify request path + String parsedPath = TestUtilities.parseReqPath(request); + assertEquals(parsedPath, pushBatchesPath); + // Verify query params + Map query = TestUtilities.parseQueryString(request); + assertNotNull(query); + assertEquals(query.get("version"), "testString"); + } + + // Test the pushBatches operation with and without retries enabled + @Test + public void testPushBatchesWRetries() throws Throwable { + discoveryService.enableRetries(4, 30); + testPushBatchesWOptions(); + + discoveryService.disableRetries(); + testPushBatchesWOptions(); + } + + // Test the pushBatches operation with a null options model (negative test) + @Test(expectedExceptions = IllegalArgumentException.class) + public void testPushBatchesNoOptions() throws Throwable { + server.enqueue(new MockResponse()); + discoveryService.pushBatches(null).execute(); + } + // Test the listDocumentClassifiers operation with a valid options model parameter @Test public void testListDocumentClassifiersWOptions() throws Throwable { diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CompletionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/BatchDetailsTest.java similarity index 72% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CompletionsTest.java rename to discovery/src/test/java/com/ibm/watson/discovery/v2/model/BatchDetailsTest.java index 99b2749bbd8..5c1dcff29df 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CompletionsTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/BatchDetailsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,26 +11,26 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.discovery.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.discovery.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the Completions model. */ -public class CompletionsTest { +/** Unit test class for the BatchDetails model. */ +public class BatchDetailsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCompletions() throws Throwable { - Completions completionsModel = new Completions(); - assertNull(completionsModel.getCompletions()); + public void testBatchDetails() throws Throwable { + BatchDetails batchDetailsModel = new BatchDetails(); + assertNull(batchDetailsModel.getEnrichmentId()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetGatewayOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/ListBatchesOptionsTest.java similarity index 60% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetGatewayOptionsTest.java rename to discovery/src/test/java/com/ibm/watson/discovery/v2/model/ListBatchesOptionsTest.java index 9214b446c77..eaa058224c9 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/GetGatewayOptionsTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/ListBatchesOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,33 +11,33 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.discovery.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.discovery.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the GetGatewayOptions model. */ -public class GetGatewayOptionsTest { +/** Unit test class for the ListBatchesOptions model. */ +public class ListBatchesOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testGetGatewayOptions() throws Throwable { - GetGatewayOptions getGatewayOptionsModel = - new GetGatewayOptions.Builder().environmentId("testString").gatewayId("testString").build(); - assertEquals(getGatewayOptionsModel.environmentId(), "testString"); - assertEquals(getGatewayOptionsModel.gatewayId(), "testString"); + public void testListBatchesOptions() throws Throwable { + ListBatchesOptions listBatchesOptionsModel = + new ListBatchesOptions.Builder().projectId("testString").collectionId("testString").build(); + assertEquals(listBatchesOptionsModel.projectId(), "testString"); + assertEquals(listBatchesOptionsModel.collectionId(), "testString"); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetGatewayOptionsError() throws Throwable { - new GetGatewayOptions.Builder().build(); + public void testListBatchesOptionsError() throws Throwable { + new ListBatchesOptions.Builder().build(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionDiskUsageTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/ListBatchesResponseTest.java similarity index 69% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionDiskUsageTest.java rename to discovery/src/test/java/com/ibm/watson/discovery/v2/model/ListBatchesResponseTest.java index a19af35a193..8e60ce09282 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CollectionDiskUsageTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/ListBatchesResponseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,25 +11,26 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.discovery.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.discovery.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the CollectionDiskUsage model. */ -public class CollectionDiskUsageTest { +/** Unit test class for the ListBatchesResponse model. */ +public class ListBatchesResponseTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCollectionDiskUsage() throws Throwable { - CollectionDiskUsage collectionDiskUsageModel = new CollectionDiskUsage(); + public void testListBatchesResponse() throws Throwable { + ListBatchesResponse listBatchesResponseModel = new ListBatchesResponse(); + assertNull(listBatchesResponseModel.getBatches()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCollectionOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/PullBatchesOptionsTest.java similarity index 59% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCollectionOptionsTest.java rename to discovery/src/test/java/com/ibm/watson/discovery/v2/model/PullBatchesOptionsTest.java index 0cd82847ae8..6f434b72ac8 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/DeleteCollectionOptionsTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/PullBatchesOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,36 +11,38 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.discovery.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.discovery.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the DeleteCollectionOptions model. */ -public class DeleteCollectionOptionsTest { +/** Unit test class for the PullBatchesOptions model. */ +public class PullBatchesOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testDeleteCollectionOptions() throws Throwable { - DeleteCollectionOptions deleteCollectionOptionsModel = - new DeleteCollectionOptions.Builder() - .environmentId("testString") + public void testPullBatchesOptions() throws Throwable { + PullBatchesOptions pullBatchesOptionsModel = + new PullBatchesOptions.Builder() + .projectId("testString") .collectionId("testString") + .batchId("testString") .build(); - assertEquals(deleteCollectionOptionsModel.environmentId(), "testString"); - assertEquals(deleteCollectionOptionsModel.collectionId(), "testString"); + assertEquals(pullBatchesOptionsModel.projectId(), "testString"); + assertEquals(pullBatchesOptionsModel.collectionId(), "testString"); + assertEquals(pullBatchesOptionsModel.batchId(), "testString"); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteCollectionOptionsError() throws Throwable { - new DeleteCollectionOptions.Builder().build(); + public void testPullBatchesOptionsError() throws Throwable { + new PullBatchesOptions.Builder().build(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsListTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/PullBatchesResponseTest.java similarity index 70% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsListTest.java rename to discovery/src/test/java/com/ibm/watson/discovery/v2/model/PullBatchesResponseTest.java index 454c7734f2f..e219749c1ea 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/CredentialsListTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/PullBatchesResponseTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,26 +11,26 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.discovery.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.discovery.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.testng.annotations.Test; -/** Unit test class for the CredentialsList model. */ -public class CredentialsListTest { +/** Unit test class for the PullBatchesResponse model. */ +public class PullBatchesResponseTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testCredentialsList() throws Throwable { - CredentialsList credentialsListModel = new CredentialsList(); - assertNull(credentialsListModel.getCredentials()); + public void testPullBatchesResponse() throws Throwable { + PullBatchesResponse pullBatchesResponseModel = new PullBatchesResponse(); + assertNull(pullBatchesResponseModel.getFile()); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AddDocumentOptionsTest.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/PushBatchesOptionsTest.java similarity index 57% rename from discovery/src/test/java/com/ibm/watson/discovery/v1/model/AddDocumentOptionsTest.java rename to discovery/src/test/java/com/ibm/watson/discovery/v2/model/PushBatchesOptionsTest.java index 88437423d46..3926863a99f 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v1/model/AddDocumentOptionsTest.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/model/PushBatchesOptionsTest.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2024. * * 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 @@ -11,47 +11,45 @@ * specific language governing permissions and limitations under the License. */ -package com.ibm.watson.discovery.v1.model; +package com.ibm.watson.discovery.v2.model; import static org.testng.Assert.*; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.discovery.v1.utils.TestUtilities; +import com.ibm.watson.discovery.v2.utils.TestUtilities; import java.io.InputStream; import java.util.HashMap; import java.util.List; import org.apache.commons.io.IOUtils; import org.testng.annotations.Test; -/** Unit test class for the AddDocumentOptions model. */ -public class AddDocumentOptionsTest { +/** Unit test class for the PushBatchesOptions model. */ +public class PushBatchesOptionsTest { final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); final List mockListFileWithMetadata = TestUtilities.creatMockListFileWithMetadata(); @Test - public void testAddDocumentOptions() throws Throwable { - AddDocumentOptions addDocumentOptionsModel = - new AddDocumentOptions.Builder() - .environmentId("testString") + public void testPushBatchesOptions() throws Throwable { + PushBatchesOptions pushBatchesOptionsModel = + new PushBatchesOptions.Builder() + .projectId("testString") .collectionId("testString") + .batchId("testString") .file(TestUtilities.createMockStream("This is a mock file.")) .filename("testString") - .fileContentType("application/json") - .metadata("testString") .build(); - assertEquals(addDocumentOptionsModel.environmentId(), "testString"); - assertEquals(addDocumentOptionsModel.collectionId(), "testString"); + assertEquals(pushBatchesOptionsModel.projectId(), "testString"); + assertEquals(pushBatchesOptionsModel.collectionId(), "testString"); + assertEquals(pushBatchesOptionsModel.batchId(), "testString"); assertEquals( - IOUtils.toString(addDocumentOptionsModel.file()), + IOUtils.toString(pushBatchesOptionsModel.file()), IOUtils.toString(TestUtilities.createMockStream("This is a mock file."))); - assertEquals(addDocumentOptionsModel.filename(), "testString"); - assertEquals(addDocumentOptionsModel.fileContentType(), "application/json"); - assertEquals(addDocumentOptionsModel.metadata(), "testString"); + assertEquals(pushBatchesOptionsModel.filename(), "testString"); } @Test(expectedExceptions = IllegalArgumentException.class) - public void testAddDocumentOptionsError() throws Throwable { - new AddDocumentOptions.Builder().build(); + public void testPushBatchesOptionsError() throws Throwable { + new PushBatchesOptions.Builder().build(); } } diff --git a/discovery/src/test/java/com/ibm/watson/discovery/v2/utils/TestUtilities.java b/discovery/src/test/java/com/ibm/watson/discovery/v2/utils/TestUtilities.java index a3905c15979..7cecabfd8f5 100644 --- a/discovery/src/test/java/com/ibm/watson/discovery/v2/utils/TestUtilities.java +++ b/discovery/src/test/java/com/ibm/watson/discovery/v2/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.discovery.v2.utils; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -18,6 +19,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; +import java.util.Base64; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -114,8 +116,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception { diff --git a/discovery/src/test/resources/discovery/v1/add_training_example_resp.json b/discovery/src/test/resources/discovery/v1/add_training_example_resp.json deleted file mode 100644 index bc3d3cd680f..00000000000 --- a/discovery/src/test/resources/discovery/v1/add_training_example_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "document_id": "mock_docid", - "relevance": 0 -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/add_training_query_resp.json b/discovery/src/test/resources/discovery/v1/add_training_query_resp.json deleted file mode 100644 index cf268ea13c8..00000000000 --- a/discovery/src/test/resources/discovery/v1/add_training_query_resp.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "query_id": "mock_queryid", - "natural_language_query": "Example query", - "examples": [ - { - "document_id": "mock_docid", - "relevance": 0 - } - ] -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/create_coll_resp.json b/discovery/src/test/resources/discovery/v1/create_coll_resp.json deleted file mode 100644 index 6d811a6ea50..00000000000 --- a/discovery/src/test/resources/discovery/v1/create_coll_resp.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "test_collection", - "description": "My test collection for doc", - "created": "2016-12-14T03:20:28.739Z", - "updated": "2016-12-14T03:20:28.739Z", - "status": "available", - "configuration_id": "c84c21d0-ac94-42bf-b619-7d277f325fdc" -} diff --git a/discovery/src/test/resources/discovery/v1/create_conf_resp.json b/discovery/src/test/resources/discovery/v1/create_conf_resp.json deleted file mode 100644 index e5067c71761..00000000000 --- a/discovery/src/test/resources/discovery/v1/create_conf_resp.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "configuration_id": "2e079259-7dd2-40a9-998f-3e716f5a7b88", - "name": "doc-config", - "description": "this is a demo configuration", - "created": "2016-12-14T02:33:34.396Z", - "updated": "2016-12-14T02:33:34.396Z", - "conversions": { - "word": { - "heading": { - "fonts": [ - { - "level": 1, - "min_size": 24, - "bold": false, - "italic": false - }, - { - "level": 2, - "min_size": 18, - "max_size": 23, - "bold": true, - "italic": false - }, - { - "level": 3, - "min_size": 14, - "max_size": 17, - "bold": false, - "italic": false - }, - { - "level": 4, - "min_size": 13, - "max_size": 13, - "bold": true, - "italic": false - } - ], - "styles": [ - { - "level": 1, - "names": [ - "pullout heading", - "pulloutheading", - "header" - ] - }, - { - "level": 2, - "names": [ - "subtitle" - ] - } - ] - } - }, - "pdf": { - "heading": { - "fonts": [ - { - "level": 1, - "min_size": 24, - "max_size": 80 - }, - { - "level": 2, - "min_size": 18, - "max_size": 24, - "bold": false, - "italic": false - }, - { - "level": 2, - "min_size": 18, - "max_size": 24, - "bold": true - }, - { - "level": 3, - "min_size": 13, - "max_size": 18, - "bold": false, - "italic": false - }, - { - "level": 3, - "min_size": 13, - "max_size": 18, - "bold": true - }, - { - "level": 4, - "min_size": 11, - "max_size": 13, - "bold": false, - "italic": false - } - ] - } - }, - "html": { - "exclude_tags_completely": [ - "script", - "sup" - ], - "exclude_tags_keep_content": [ - "font", - "em", - "span" - ], - "exclude_content": { - "xpaths": [] - }, - "keep_content": { - "xpaths": [] - }, - "exclude_tag_attributes": [ - "EVENT_ACTIONS" - ] - }, - "json_normalizations": [] - }, - "enrichments": [ - { - "destination_field": "enriched_text", - "source_field": "text", - "enrichment": "alchemy_language", - "options": { - "extract": [ - "keyword", - "entity", - "doc-sentiment", - "taxonomy", - "concept", - "relation" - ], - "sentiment": true, - "quotations": true - } - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/create_doc_resp.json b/discovery/src/test/resources/discovery/v1/create_doc_resp.json deleted file mode 100644 index f89b8a20406..00000000000 --- a/discovery/src/test/resources/discovery/v1/create_doc_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "document_id": "8691f0dd-7181-45b7-81de-5cb16206b3a1", - "status": "pending" -} diff --git a/discovery/src/test/resources/discovery/v1/create_env_resp.json b/discovery/src/test/resources/discovery/v1/create_env_resp.json deleted file mode 100644 index 5b0109a68d9..00000000000 --- a/discovery/src/test/resources/discovery/v1/create_env_resp.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "environment_id": "9e21069a-8bc1-475e-a1d3-2121c49ef060", - "name": "my_environment", - "description": "My Discovery environment", - "created": "2016-12-14T17:32:41.593Z", - "updated": "2016-12-14T17:32:41.593Z", - "status": "pending", - "read_only": false, - "index_capacity": { - "disk_usage": { - "used_bytes": 0, - "total_bytes": 1073741824, - "used": "0 KB", - "total": "1024 MB", - "percent_used": 0 - }, - "memory_usage": { - "used_bytes": 0, - "total_bytes": 0, - "used": "0 KB", - "total": "0 KB", - "percent_used": 0 - } - } -} diff --git a/discovery/src/test/resources/discovery/v1/create_event_resp.json b/discovery/src/test/resources/discovery/v1/create_event_resp.json deleted file mode 100644 index 7d5a3ef391b..00000000000 --- a/discovery/src/test/resources/discovery/v1/create_event_resp.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "click", - "data": { - "environment_id": "mock_envid", - "session_token": "mock_session_token", - "client_timestamp": "2016-12-14T17:32:41.593Z", - "display_rank": 1, - "collection_id": "mock_collid", - "document_id": "mock_docid", - "query_id": "mock_queryid" - } -} diff --git a/discovery/src/test/resources/discovery/v1/credentials_resp.json b/discovery/src/test/resources/discovery/v1/credentials_resp.json deleted file mode 100644 index 358c4bbd58b..00000000000 --- a/discovery/src/test/resources/discovery/v1/credentials_resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "credential_id" : "00000d8c-0000-00e8-ba89-0ed5f89f718b", - "source_type" : "salesforce", - "credential_details" : { - "credential_type" : "username_password", - "url" : "login.salesforce.com", - "username" : "user@email.address" - } -} diff --git a/discovery/src/test/resources/discovery/v1/delete_coll_resp.json b/discovery/src/test/resources/discovery/v1/delete_coll_resp.json deleted file mode 100644 index 5a5203844be..00000000000 --- a/discovery/src/test/resources/discovery/v1/delete_coll_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "collection_id": "44e29a9a-47e3-4acd-874b-c7cbe04043f1", - "status": "deleted" -} diff --git a/discovery/src/test/resources/discovery/v1/delete_conf_resp.json b/discovery/src/test/resources/discovery/v1/delete_conf_resp.json deleted file mode 100644 index 81d69519c50..00000000000 --- a/discovery/src/test/resources/discovery/v1/delete_conf_resp.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", - "status": "deleted", - "notices": [ - { - "notice_id": "configuration_in_use", - "created": "2016-09-28T12:34:00.000Z", - "severity": "warning", - "description": "The configuration was deleted, but it is referenced by one or more collections." - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/delete_credentials_resp.json b/discovery/src/test/resources/discovery/v1/delete_credentials_resp.json deleted file mode 100644 index a585f793f95..00000000000 --- a/discovery/src/test/resources/discovery/v1/delete_credentials_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "credential_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", - "status": "deleted" -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/delete_doc_resp.json b/discovery/src/test/resources/discovery/v1/delete_doc_resp.json deleted file mode 100644 index 6aeba34b3a0..00000000000 --- a/discovery/src/test/resources/discovery/v1/delete_doc_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "document_id": "8691f0dd-7181-45b7-81de-5cb16206b3a1", - "status": "deleted" -} diff --git a/discovery/src/test/resources/discovery/v1/delete_env_resp.json b/discovery/src/test/resources/discovery/v1/delete_env_resp.json deleted file mode 100644 index 53df6cea614..00000000000 --- a/discovery/src/test/resources/discovery/v1/delete_env_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "environment_id": "{environment_id}", - "status": "deleted" -} diff --git a/discovery/src/test/resources/discovery/v1/delete_gateway_resp.json b/discovery/src/test/resources/discovery/v1/delete_gateway_resp.json deleted file mode 100644 index 05565564d51..00000000000 --- a/discovery/src/test/resources/discovery/v1/delete_gateway_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "gateway_id": "8691f0dd-7181-45b7-81de-5cb16206b3a1", - "status": "deleted" -} diff --git a/discovery/src/test/resources/discovery/v1/expansions_resp.json b/discovery/src/test/resources/discovery/v1/expansions_resp.json deleted file mode 100644 index 3456f883d6f..00000000000 --- a/discovery/src/test/resources/discovery/v1/expansions_resp.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "expansions": [ - { - "input_terms": [ - "weekday", - "week day" - ], - "expanded_terms": [ - "monday", - "tuesday", - "wednesday", - "thursday", - "friday" - ] - }, - { - "input_terms": [ - "weekend", - "week end" - ], - "expanded_terms": [ - "saturday", - "sunday" - ] - } - ] -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/gateway_resp.json b/discovery/src/test/resources/discovery/v1/gateway_resp.json deleted file mode 100644 index 59a8c308449..00000000000 --- a/discovery/src/test/resources/discovery/v1/gateway_resp.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "gateway_id": "gateway_id", - "name": "name", - "status": "connected", - "token": "token", - "token_id": "token_id" -} diff --git a/discovery/src/test/resources/discovery/v1/get_coll1_resp.json b/discovery/src/test/resources/discovery/v1/get_coll1_resp.json deleted file mode 100644 index aa9b74f432c..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_coll1_resp.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "collection_id": "44e29a9a-47e3-4acd-874b-c7cbe04043f1", - "name": "test_collection", - "created": "2016-12-14T18:42:25.324Z", - "updated": "2016-12-14T18:42:25.324Z", - "status": "available", - "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b", - "language": "en_us", - "document_counts": { - "available": 1000, - "processing": 20, - "failed": 180 - } -} diff --git a/discovery/src/test/resources/discovery/v1/get_coll_resp.json b/discovery/src/test/resources/discovery/v1/get_coll_resp.json deleted file mode 100644 index 3428eddeba7..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_coll_resp.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "collections": [ - { - "collection_id": "44e29a9a-47e3-4acd-874b-c7cbe04043f1", - "name": "test_collection", - "created": "2016-12-14T18:42:25.324Z", - "updated": "2016-12-14T18:42:25.324Z", - "status": "available", - "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b", - "language": "en_us" - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/get_conf_resp.json b/discovery/src/test/resources/discovery/v1/get_conf_resp.json deleted file mode 100644 index 1c38c4bca7a..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_conf_resp.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "configuration_id": "2e079259-7dd2-40a9-998f-3e716f5a7b88", - "name": "doc-config", - "description": "this is a demo configuration", - "created": "2016-11-03T02:33:34.396Z", - "updated": "2016-11-03T02:33:34.396Z", - "conversions": { - "word": { - "heading": { - "fonts": [ - { - "level": 1, - "min_size": 24, - "bold": false, - "italic": false - }, - { - "level": 2, - "min_size": 18, - "max_size": 23, - "bold": true, - "italic": false - }, - { - "level": 3, - "min_size": 14, - "max_size": 17, - "bold": false, - "italic": false - }, - { - "level": 4, - "min_size": 13, - "max_size": 13, - "bold": true, - "italic": false - } - ], - "styles": [ - { - "level": 1, - "names": [ - "pullout heading", - "pulloutheading", - "header" - ] - }, - { - "level": 2, - "names": [ - "subtitle" - ] - } - ] - } - }, - "pdf": { - "heading": { - "fonts": [ - { - "level": 1, - "min_size": 24, - "max_size": 80 - }, - { - "level": 2, - "min_size": 18, - "max_size": 24, - "bold": false, - "italic": false - }, - { - "level": 2, - "min_size": 18, - "max_size": 24, - "bold": true - }, - { - "level": 3, - "min_size": 13, - "max_size": 18, - "bold": false, - "italic": false - }, - { - "level": 3, - "min_size": 13, - "max_size": 18, - "bold": true - }, - { - "level": 4, - "min_size": 11, - "max_size": 13, - "bold": false, - "italic": false - } - ] - } - }, - "html": { - "exclude_tags_completely": [ - "script", - "sup" - ], - "exclude_tags_keep_content": [ - "font", - "em", - "span" - ], - "exclude_content": { - "xpaths": [] - }, - "keep_content": { - "xpaths": [] - }, - "exclude_tag_attributes": [ - "EVENT_ACTIONS" - ] - }, - "json_normalizations": [] - }, - "enrichments": [ - { - "destination_field": "enriched_text", - "source_field": "text", - "enrichment": "alchemy_language", - "options": { - "extract": [ - "keyword", - "entity", - "doc-sentiment", - "taxonomy", - "concept", - "relation" - ], - "sentiment": true, - "quotations": true - } - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/get_confs_resp.json b/discovery/src/test/resources/discovery/v1/get_confs_resp.json deleted file mode 100644 index 50083f93f81..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_confs_resp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "configurations": [ - { - "configuration_id": "210081cb-796f-463d-ab88-a07595f452a9", - "name": "default-config", - "description": "This is a test configuration.", - "created": "2016-11-01T17:47:30.678Z", - "updated": "2016-11-01T17:47:30.678Z" - }, - { - "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", - "name": "democonfig", - "description": "this is a demo configuration", - "created": "2016-12-14T18:42:25.324Z", - "updated": "2016-12-14T18:42:25.324Z" - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/get_doc_resp.json b/discovery/src/test/resources/discovery/v1/get_doc_resp.json deleted file mode 100644 index 36626fafa3b..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_doc_resp.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "document_id": "8691f0dd-7181-45b7-81de-5cb16206b3a1", - "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b", - "created": "2016-11-02T18:42:25.324Z", - "updated": "2016-11-03T09:02:41.585Z", - "status": "pending", - "notices": [ - { - "notice_id": "index_342", - "severity": "warning", - "step": "indexing", - "description": "DANGER, WILL ROBINSON!" - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/get_env_resp.json b/discovery/src/test/resources/discovery/v1/get_env_resp.json deleted file mode 100644 index 65afb765910..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_env_resp.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "environment_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", - "name": "my_environment", - "description": "My environment", - "created": "2016-12-14T17:32:41.593Z", - "updated": "2016-12-14T17:32:41.593Z", - "status": "resizing", - "index_capacity": { - "disk_usage": { - "used_bytes": 0, - "total_bytes": 1073741824, - "used": "0 KB", - "total": "1024 MB", - "percent_used": 0 - }, - "memory_usage": { - "used_bytes": 140266264, - "total_bytes": 518979584, - "used": "133.77 MB", - "total": "494.94 MB", - "percent_used": 27.03 - } - }, - "requested_size": "LT", - "search_status": { - "scope": "environment", - "status": "TRAINING", - "status_description": "The environment is training.", - "last_trained": "2016-12-14T17:32:41.593Z" - } -} diff --git a/discovery/src/test/resources/discovery/v1/get_envs_resp.json b/discovery/src/test/resources/discovery/v1/get_envs_resp.json deleted file mode 100644 index bd3076b111c..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_envs_resp.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "environments": [ - { - "environment_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", - "name": "my_environment", - "description": "My environment", - "created": "2016-12-14T17:32:41.593Z", - "updated": "2016-12-14T17:32:41.593Z", - "status": "available", - "index_capacity": { - "disk_usage": { - "used_bytes": 0, - "total_bytes": 1073741824, - "used": "0 KB", - "total": "1024 MB", - "percent_used": 0 - }, - "memory_usage": { - "used_bytes": 137456520, - "total_bytes": 518979584, - "used": "131.09 MB", - "total": "494.94 MB", - "percent_used": 26.49 - } - } - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/get_training_data_resp.json b/discovery/src/test/resources/discovery/v1/get_training_data_resp.json deleted file mode 100644 index cf268ea13c8..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_training_data_resp.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "query_id": "mock_queryid", - "natural_language_query": "Example query", - "examples": [ - { - "document_id": "mock_docid", - "relevance": 0 - } - ] -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/get_training_example_resp.json b/discovery/src/test/resources/discovery/v1/get_training_example_resp.json deleted file mode 100644 index bc3d3cd680f..00000000000 --- a/discovery/src/test/resources/discovery/v1/get_training_example_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "document_id": "mock_docid", - "relevance": 0 -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/issue517.json b/discovery/src/test/resources/discovery/v1/issue517.json deleted file mode 100644 index 5c4ee81a99b..00000000000 --- a/discovery/src/test/resources/discovery/v1/issue517.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "my_config", - "conversions": { - "json_normalizations": [ - { - "operation": "copy", - "source_field": "some_field", - "destination_field": "other_field" - } - ] - } -} diff --git a/discovery/src/test/resources/discovery/v1/issue518.json b/discovery/src/test/resources/discovery/v1/issue518.json deleted file mode 100644 index 2e32c2ac4f7..00000000000 --- a/discovery/src/test/resources/discovery/v1/issue518.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e", - "name": "IBM News", - "created": "2015-08-24T18:42:25.324Z", - "updated": "2015-08-24T18:42:25.324Z", - "description": "A configuration useful for ingesting IBM press releases.", - "conversions": { - "html": { - "exclude_tags_keep_content": [ - "span" - ], - "exclude_content": { - "xpaths": [ - "/home" - ] - } - }, - "json_normalizations": [ - { - "operation": "move", - "source_field": "extracted_metadata.title", - "destination_field": "metadata.title" - }, - { - "operation": "move", - "source_field": "extracted_metadata.author", - "destination_field": "metadata.author" - }, - { - "operation": "remove", - "source_field": "extracted_metadata" - } - ] - }, - "enrichments": [ - { - "source_field": "text", - "destination_field": "alchemy_enriched_text", - "enrichment": "alchemy_language", - "options": { - "extract": [ - "keyword" - ], - "showSourceText": true - } - }, - { - "source_field": "alchemy_enriched_text.text", - "destination_field": "sire_enriched_text", - "enrichment": "alchemy_language", - "options": { - "extract": [ - "typed-rels" - ], - "model": "ie-en-news" - } - } - ], - "normalizations": [ - { - "operation": "move", - "source_field": "metadata.title", - "destination_field": "title" - }, - { - "operation": "copy", - "source_field": "metadata.author", - "destination_field": "author" - }, - { - "operation": "merge", - "source_field": "alchemy_enriched_text.language", - "destination_field": "language" - }, - { - "operation": "remove", - "source_field": "html" - }, - { - "operation": "remove_nulls" - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/list_credentials_resp.json b/discovery/src/test/resources/discovery/v1/list_credentials_resp.json deleted file mode 100644 index 50af9a38006..00000000000 --- a/discovery/src/test/resources/discovery/v1/list_credentials_resp.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "credentials" : [ { - "credential_id" : "00000d8c-0000-00e8-ba89-0ed5f89f718b", - "source_type" : "salesforce", - "credential_details" : { - "credential_type" : "username_password", - "url" : "login.salesforce.com", - "username" : "user@email.address" - } - }, { - "credential_id" : "00000d8c-0000-00e8-ba89-0ed5f89f111c", - "source_type" : "box", - "credential_details" : { - "credential_type" : "oauth2", - "client_id" : "1234567899bz7micz6x6p5zfnycw98e3", - "enterprise_id" : "000000001" - } - }, { - "credential_id" : "00000d8c-0000-00e8-ba22-0ed5f89f999d", - "source_type" : "sharepoint", - "credential_details" : { - "credential_type" : "saml", - "organization_url" : "https://site001.sharepointonline.com", - "site_collection_path" : "/sites/TestSite1", - "username" : "userA@sharepointonline.com" - } - } ] -} diff --git a/discovery/src/test/resources/discovery/v1/list_fields_resp.json b/discovery/src/test/resources/discovery/v1/list_fields_resp.json deleted file mode 100644 index 2a34d013a75..00000000000 --- a/discovery/src/test/resources/discovery/v1/list_fields_resp.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "fields": [ - { - "field": "field", - "type": "string" - } - ] -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/list_gateways_resp.json b/discovery/src/test/resources/discovery/v1/list_gateways_resp.json deleted file mode 100644 index 58f2a9a384b..00000000000 --- a/discovery/src/test/resources/discovery/v1/list_gateways_resp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "gateways": [ - { - "gateway_id": "gateway_id_1", - "name": "name", - "status": "connected", - "token": "token", - "token_id": "token_id" - }, - { - "gateway_id": "gateway_id_2", - "name": "name", - "status": "connected", - "token": "token", - "token_id": "token_id" - }, - ] -} diff --git a/discovery/src/test/resources/discovery/v1/list_training_data_resp.json b/discovery/src/test/resources/discovery/v1/list_training_data_resp.json deleted file mode 100644 index 503353e69bd..00000000000 --- a/discovery/src/test/resources/discovery/v1/list_training_data_resp.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "environment_id": "mock_envid", - "collection_id": "mock_confid", - "queries": [ - { - "query_id": "mock_queryid", - "natural_language_query": "Example query", - "examples": [ - { - "document_id": "mock_docid", - "relevance": 0 - } - ] - } - ] -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/list_training_examples_resp.json b/discovery/src/test/resources/discovery/v1/list_training_examples_resp.json deleted file mode 100644 index cdfd587bf69..00000000000 --- a/discovery/src/test/resources/discovery/v1/list_training_examples_resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "examples": [ - { - "document_id": "mock_docid", - "relevance": 0, - "cross_reference": "cross_reference" - } - ] -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/listfields_coll_resp.json b/discovery/src/test/resources/discovery/v1/listfields_coll_resp.json deleted file mode 100644 index dc45c39a1b2..00000000000 --- a/discovery/src/test/resources/discovery/v1/listfields_coll_resp.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "fields": [ - { - "field": "warnings", - "type": "nested" - }, - { - "field": "warnings.properties.description", - "type": "string" - }, - { - "field": "warnings.properties.phase", - "type": "string" - }, - { - "field": "warnings.properties.warning_id", - "type": "string" - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/log_query_resp.json b/discovery/src/test/resources/discovery/v1/log_query_resp.json deleted file mode 100644 index 8d7eb2d5f08..00000000000 --- a/discovery/src/test/resources/discovery/v1/log_query_resp.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "matching_results": 2, - "results": [ - { - "environment_id": "mock_envid", - "customer_id": "", - "natural_language_query": "Who beat Ken Jennings in Jeopardy!", - "document_results": { - "results": [], - "count": 0 - }, - "created_timestamp": "2018-07-16T18:27:26.433", - "query_id": "mock_queryid", - "session_token": "mock_session_token", - "event_type": "query" - }, - { - "environment_id": "mock_envid", - "customer_id": "", - "document_results": { - "results": [ - { - "position": 1, - "document_id": "mock_docid", - "score": 1.0, - "collection_id": "mock_collid" - }, - { - "position": 2, - "document_id": "mock_docid", - "score": 1.0, - "collection_id": "mock_collid" - } - ], - "count": 2 - }, - "created_timestamp": "2018-07-19T11:10:32.243", - "query_id": "mock_queryid", - "session_token": "mock_session_token", - "event_type": "query" - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/metric_resp.json b/discovery/src/test/resources/discovery/v1/metric_resp.json deleted file mode 100644 index 012289e7a4c..00000000000 --- a/discovery/src/test/resources/discovery/v1/metric_resp.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "aggregations": [ - { - "interval": "1d", - "event_type": "click", - "results": [ - { - "key_as_string": "2018-08-05T20:00:00.000", - "key": 1533513600000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-06T20:00:00.000", - "key": 1533600000000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-07T20:00:00.000", - "key": 1533686400000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-08T20:00:00.000", - "key": 1533772800000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-09T20:00:00.000", - "key": 1533859200000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-10T20:00:00.000", - "key": 1533945600000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-11T20:00:00.000", - "key": 1534032000000, - "event_rate": 0.0 - }, - { - "key_as_string": "2018-08-12T20:00:00.000", - "key": 1534118400000, - "event_rate": 0.09090909090909091 - } - ] - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/metric_token_resp.json b/discovery/src/test/resources/discovery/v1/metric_token_resp.json deleted file mode 100644 index 19f33e21d81..00000000000 --- a/discovery/src/test/resources/discovery/v1/metric_token_resp.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "aggregations": [ - { - "event_type": "click", - "results": [ - { - "key": "beat", - "matching_results": 117, - "event_rate": 0.0 - }, - { - "key": "in", - "matching_results": 117, - "event_rate": 0.0 - }, - { - "key": "jennings", - "matching_results": 117, - "event_rate": 0.0 - }, - { - "key": "jeopardy", - "matching_results": 117, - "event_rate": 0.0 - }, - { - "key": "ken", - "matching_results": 117, - "event_rate": 0.0 - }, - { - "key": "who", - "matching_results": 117, - "event_rate": 0.0 - }, - { - "key": "watson", - "matching_results": 3, - "event_rate": 0.0 - }, - { - "key": "1", - "matching_results": 2, - "event_rate": 0.5 - }, - { - "key": "field", - "matching_results": 2, - "event_rate": 0.5 - }, - { - "key": "number", - "matching_results": 2, - "event_rate": 0.5 - } - ] - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/passages_test_doc_1.json b/discovery/src/test/resources/discovery/v1/passages_test_doc_1.json deleted file mode 100644 index c065af80ae5..00000000000 --- a/discovery/src/test/resources/discovery/v1/passages_test_doc_1.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "text": "Celgene and IBM Watson Health Forge Collaboration Designed to Transform Patient Safety Monitoring\nCelgene Corporation and IBM Watson Health today announced a collaboration to co-develop IBM Watson for Patient Safety, a new offering that aims to enhance pharmacovigilance methods used to collect, assess, monitor, and report adverse drug reactions. The new offering will run on the Watson Health Cloud." -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/passages_test_doc_2.json b/discovery/src/test/resources/discovery/v1/passages_test_doc_2.json deleted file mode 100644 index 3dde183fe61..00000000000 --- a/discovery/src/test/resources/discovery/v1/passages_test_doc_2.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "text": "Slack, IBM Partner to Bring Watson to Developers\nIBM and Slack are partnering to bring Watson to Slack’s global community of developers and enterprise users. Drawing on the power of Slack’s digital workplace and the cognitive computing capabilities of Watson, developers will be able to create more offerings — including bots and other conversational inferences — that will transform the platform’s user experience. Developers can easily access the range of Watson services -- such as Conversation, Sentiment Analysis or speech APIs -- and build powerful new tools for the platform with this enhanced cognitive functionality." -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/query1_resp.json b/discovery/src/test/resources/discovery/v1/query1_resp.json deleted file mode 100644 index af8303c5054..00000000000 --- a/discovery/src/test/resources/discovery/v1/query1_resp.json +++ /dev/null @@ -1,536 +0,0 @@ -{ - "matching_results": 4, - "results": [ - { - "id": "4f70a05d-6ef2-4a46-be87-380724995af8", - "score": 1, - "extracted_metadata": { - "title": "Celgene and IBM Watson Health Forge Collaboration Designed to Transform Patient Safety Monitoring" - }, - "html": "\n\n Celgene and IBM Watson Health Forge Collaboration Designed to Transform Patient Safety Monitoring\n\n\n\n\n

Published: Tue, 01 Nov 2016 08:32:23 GMT

\n

Celgene Corporation and IBM Watson Health today announced a collaboration to co-develop IBM Watson for Patient Safety, a new offering that aims to enhance pharmacovigilance methods used to collect, assess, monitor, and report adverse drug reactions. The new offering will run on the Watson Health Cloud.

\n

URL: http://www.ibm.com/press/us/en/pressrelease/50927.wss

\n\n\n", - "text": "Celgene and IBM Watson Health Forge Collaboration Designed to Transform Patient Safety Monitoring\n\nPublished: Tue, 01 Nov 2016 08:32:23 GMT\n\nCelgene Corporation and IBM Watson Health today announced a collaboration to co-develop IBM Watson for Patient Safety, a new offering that aims to enhance pharmacovigilance methods used to collect, assess, monitor, and report adverse drug reactions. The new offering will run on the Watson Health Cloud.\n\nURL: http://www.ibm.com/press/us/en/pressrelease/50927.wss", - "enriched_text": { - "status": "OK", - "language": "english", - "docSentiment": { - "type": "positive", - "score": 0.349018, - "mixed": true - }, - "concepts": [ - { - "text": "Adverse drug reaction", - "relevance": 0.97198, - "knowledgeGraph": { - "typeHierarchy": "/adverse events/adverse drug reaction" - }, - "dbpedia": "http://dbpedia.org/resource/Adverse_drug_reaction", - "freebase": "http://rdf.freebase.com/ns/m.04p93k" - }, - { - "text": "Pharmacovigilance", - "relevance": 0.57362, - "knowledgeGraph": { - "typeHierarchy": "/directors/pharmacovigilance" - }, - "dbpedia": "http://dbpedia.org/resource/Pharmacovigilance", - "freebase": "http://rdf.freebase.com/ns/m.04lmfb" - }, - { - "text": "Thomas J. Watson", - "relevance": 0.507165, - "knowledgeGraph": { - "typeHierarchy": "/people/thomas j. watson" - }, - "dbpedia": "http://dbpedia.org/resource/Thomas_J._Watson", - "freebase": "http://rdf.freebase.com/ns/m.07qkt", - "yago": "http://yago-knowledge.org/resource/Thomas_J._Watson" - }, - { - "text": "Illness", - "relevance": 0.497042, - "knowledgeGraph": { - "typeHierarchy": "/issues/conditions/circumstances/illness" - }, - "dbpedia": "http://dbpedia.org/resource/Illness", - "freebase": "http://rdf.freebase.com/ns/m.01jwdy" - }, - { - "text": "Lotus Software", - "relevance": 0.482834, - "knowledgeGraph": { - "typeHierarchy": "/products/materials/software/lotus software" - }, - "website": "http://www.ibm.com/software/lotus", - "dbpedia": "http://dbpedia.org/resource/Lotus_Software", - "freebase": "http://rdf.freebase.com/ns/m.0q4jd", - "opencyc": "http://sw.opencyc.org/concept/Mx4rvViJIZwpEbGdrcN5Y29ycA", - "yago": "http://yago-knowledge.org/resource/Lotus_Software" - }, - { - "text": "Pharmacology", - "relevance": 0.441008, - "knowledgeGraph": { - "typeHierarchy": "/fields/pharmacology" - }, - "dbpedia": "http://dbpedia.org/resource/Pharmacology", - "freebase": "http://rdf.freebase.com/ns/m.062p_", - "opencyc": "http://sw.opencyc.org/concept/Mx4rwQFiYJwpEbGdrcN5Y29ycA" - }, - { - "text": "Thomas J. Watson Research Center", - "relevance": 0.4094, - "knowledgeGraph": { - "typeHierarchy": "/organizations/research centers/thomas j. watson research center" - }, - "dbpedia": "http://dbpedia.org/resource/Thomas_J._Watson_Research_Center", - "freebase": "http://rdf.freebase.com/ns/m.04zkt5", - "yago": "http://yago-knowledge.org/resource/Thomas_J._Watson_Research_Center" - } - ], - "entities": [ - { - "type": "Company", - "relevance": 0.939431, - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson health" - }, - "sentiment": { - "type": "positive", - "score": 0.394824, - "mixed": false - }, - "count": 1, - "text": "IBM Watson Health" - }, - { - "type": "Facility", - "relevance": 0.936844, - "knowledgeGraph": { - "typeHierarchy": "/people/watson health forge" - }, - "sentiment": { - "type": "positive", - "score": 0.450045, - "mixed": false - }, - "count": 1, - "text": "Watson Health Forge" - }, - { - "type": "Facility", - "relevance": 0.900379, - "knowledgeGraph": { - "typeHierarchy": "/people/watson health cloud" - }, - "sentiment": { - "type": "positive", - "score": 0.793685, - "mixed": false - }, - "count": 1, - "text": "Watson Health Cloud" - }, - { - "type": "Company", - "relevance": 0.847945, - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson" - }, - "sentiment": { - "type": "positive", - "score": 0.394824, - "mixed": false - }, - "count": 1, - "text": "IBM Watson" - }, - { - "type": "JobTitle", - "relevance": 0.688245, - "knowledgeGraph": { - "typeHierarchy": "/issues/patient safety/transform patient safety monitoring" - }, - "sentiment": { - "type": "positive", - "score": 0.450045, - "mixed": false - }, - "count": 1, - "text": "Transform Patient Safety Monitoring" - }, - { - "type": "Company", - "relevance": 0.514877, - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm" - }, - "sentiment": { - "type": "positive", - "score": 0.450045, - "mixed": false - }, - "count": 1, - "text": "IBM", - "disambiguated": { - "subType": [ - "SoftwareLicense", - "OperatingSystemDeveloper", - "ProcessorManufacturer", - "SoftwareDeveloper", - "CompanyFounder", - "ProgrammingLanguageDesigner", - "ProgrammingLanguageDeveloper" - ], - "name": "IBM", - "website": "http://www.ibm.com/", - "dbpedia": "http://dbpedia.org/resource/IBM", - "freebase": "http://rdf.freebase.com/ns/m.03sc8", - "opencyc": "http://sw.opencyc.org/concept/Mx4rvViMoJwpEbGdrcN5Y29ycA", - "yago": "http://yago-knowledge.org/resource/IBM", - "crunchbase": "http://www.crunchbase.com/company/ibm" - } - }, - { - "type": "Company", - "relevance": 0.332536, - "knowledgeGraph": { - "typeHierarchy": "/companies/organizations/celgene corporation" - }, - "sentiment": { - "type": "positive", - "score": 0.394824, - "mixed": false - }, - "count": 1, - "text": "Celgene Corporation", - "disambiguated": { - "subType": [ - "VentureFundedCompany" - ], - "name": "Celgene", - "website": "http://www.celgene.com/", - "dbpedia": "http://dbpedia.org/resource/Celgene", - "freebase": "http://rdf.freebase.com/ns/m.0898kv", - "opencyc": "http://sw.opencyc.org/concept/Mx4rvZdBy5wpEbGdrcN5Y29ycA", - "yago": "http://yago-knowledge.org/resource/Celgene" - } - }, - { - "type": "Person", - "relevance": 0.307186, - "knowledgeGraph": { - "typeHierarchy": "/companies/organizations/celgene" - }, - "sentiment": { - "type": "positive", - "score": 0.450045, - "mixed": false - }, - "count": 1, - "text": "Celgene" - } - ], - "relations": [ - { - "sentence": " Celgene Corporation and IBM Watson Health today announced a collaboration to co-develop IBM Watson for Patient Safety, a new offering that aims to enhance pharmacovigilance methods used to collect, assess, monitor, and report adverse drug reactions.", - "subject": { - "text": "Celgene Corporation and IBM Watson Health today", - "entities": [ - { - "type": "Company", - "text": "Celgene Corporation", - "knowledgeGraph": { - "typeHierarchy": "/companies/organizations/celgene corporation" - }, - "disambiguated": { - "subType": [ - "Organization", - "Company", - "VentureFundedCompany" - ], - "name": "Celgene", - "website": "http://www.celgene.com/", - "dbpedia": "http://dbpedia.org/resource/Celgene", - "freebase": "http://rdf.freebase.com/ns/m.0898kv", - "opencyc": "http://sw.opencyc.org/concept/Mx4rvZdBy5wpEbGdrcN5Y29ycA", - "yago": "http://yago-knowledge.org/resource/Celgene" - } - }, - { - "type": "Company", - "text": "IBM Watson Health", - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson health" - } - } - ], - "keywords": [ - { - "text": "IBM Watson Health", - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson health" - } - }, - { - "text": "Celgene Corporation", - "knowledgeGraph": { - "typeHierarchy": "/companies/organizations/celgene corporation" - } - } - ] - }, - "action": { - "text": "announced", - "lemmatized": "announce", - "verb": { - "text": "announce", - "tense": "past" - } - }, - "object": { - "text": "a collaboration to co-develop IBM Watson for Patient Safety, a new offering that aims to enhance pharmacovigilance methods used to collect, assess, monitor, and report adverse drug reactions", - "sentiment": { - "type": "positive", - "score": 0.576836, - "mixed": false - }, - "entities": [ - { - "type": "Company", - "text": "IBM Watson", - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson" - } - } - ], - "keywords": [ - { - "text": "adverse drug reactions", - "knowledgeGraph": { - "typeHierarchy": "/adverse events/adverse drug reactions" - } - }, - { - "text": "pharmacovigilance methods", - "knowledgeGraph": { - "typeHierarchy": "/tools/resources/materials/methods/pharmacovigilance methods" - } - }, - { - "text": "IBM Watson", - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson" - } - }, - { - "text": "Patient Safety", - "knowledgeGraph": { - "typeHierarchy": "/issues/patient safety" - } - } - ] - } - }, - { - "sentence": " Celgene Corporation and IBM Watson Health today announced a collaboration to co-develop IBM Watson for Patient Safety, a new offering that aims to enhance pharmacovigilance methods used to collect, assess, monitor, and report adverse drug reactions.", - "subject": { - "text": "a new offering", - "sentiment": { - "type": "positive", - "score": 0.639534, - "mixed": false - }, - "keywords": [ - { - "text": "new offering" - } - ] - }, - "action": { - "text": "aims", - "lemmatized": "aim", - "verb": { - "text": "aim", - "tense": "present" - } - }, - "object": { - "text": "to enhance pharmacovigilance methods used to collect", - "keywords": [ - { - "text": "pharmacovigilance methods", - "knowledgeGraph": { - "typeHierarchy": "/tools/resources/materials/methods/pharmacovigilance methods" - } - } - ] - } - }, - { - "sentence": " The new offering will run on the Watson Health Cloud.", - "subject": { - "text": "The new offering", - "sentiment": { - "type": "positive", - "score": 0.451284, - "mixed": false - }, - "keywords": [ - { - "text": "new offering" - } - ] - }, - "action": { - "text": "will run", - "lemmatized": "will run", - "verb": { - "text": "run", - "tense": "future" - } - }, - "location": { - "text": "on the Watson Health Cloud", - "entities": [ - { - "type": "Facility", - "text": "Watson Health Cloud", - "knowledgeGraph": { - "typeHierarchy": "/people/watson health cloud" - } - } - ] - } - } - ], - "taxonomy": [ - { - "label": "/health and fitness", - "score": 0.613225, - "confident": false - }, - { - "label": "/business and industrial/company/bankruptcy", - "score": 0.413686, - "confident": false - }, - { - "confident": false, - "label": "/technology and computing", - "score": 0.325571 - } - ], - "keywords": [ - { - "knowledgeGraph": { - "typeHierarchy": "/organizations/companies/ibm/ibm watson health" - }, - "relevance": 0.944488, - "sentiment": { - "score": 0.422434, - "type": "positive", - "mixed": false - }, - "text": "IBM Watson Health" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/people/watson health forge" - }, - "relevance": 0.666311, - "sentiment": { - "score": 0.450045, - "type": "positive", - "mixed": false - }, - "text": "Watson Health Forge" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/people/watson health cloud" - }, - "relevance": 0.531944, - "sentiment": { - "score": 0.793685, - "type": "positive", - "mixed": false - }, - "text": "Watson Health Cloud" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/issues/patient safety/transform patient safety" - }, - "relevance": 0.47957, - "sentiment": { - "score": 0.450045, - "type": "positive", - "mixed": false - }, - "text": "Transform Patient Safety" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/adverse events/adverse drug reactions" - }, - "relevance": 0.445181, - "sentiment": { - "type": "neutral", - "mixed": false - }, - "text": "adverse drug reactions" - }, - { - "relevance": 0.400895, - "sentiment": { - "score": 0.644874, - "type": "positive", - "mixed": false - }, - "text": "new offering" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/activities/services/applications/collaboration/collaboration designed" - }, - "relevance": 0.301433, - "sentiment": { - "score": 0.450045, - "type": "positive", - "mixed": false - }, - "text": "Collaboration Designed" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/tools/resources/materials/methods/pharmacovigilance methods" - }, - "relevance": 0.27876, - "sentiment": { - "score": 0.496064, - "type": "positive", - "mixed": false - }, - "text": "pharmacovigilance methods" - }, - { - "knowledgeGraph": { - "typeHierarchy": "/companies/organizations/celgene corporation" - }, - "relevance": 0.220786, - "sentiment": { - "score": 0.394824, - "type": "positive", - "mixed": false - }, - "text": "Celgene Corporation" - } - ] - } - } - ], - "retrieval_details": { - "document_retrieval_strategy": "relevancy_training" - } -} diff --git a/discovery/src/test/resources/discovery/v1/stopwords.txt b/discovery/src/test/resources/discovery/v1/stopwords.txt deleted file mode 100644 index 20089a6d716..00000000000 --- a/discovery/src/test/resources/discovery/v1/stopwords.txt +++ /dev/null @@ -1,35 +0,0 @@ -| US English default stopword list - -a -an -and -are -as -at -be -but -by -for -if -in -into -is -it -no -not -of -on -or -such -that -the -their -then -there -these -they -this -to -was -will -with diff --git a/discovery/src/test/resources/discovery/v1/test-config.json b/discovery/src/test/resources/discovery/v1/test-config.json deleted file mode 100644 index 120e8b6da26..00000000000 --- a/discovery/src/test/resources/discovery/v1/test-config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "watson_developer_cloud_config" -} diff --git a/discovery/src/test/resources/discovery/v1/token_dict_status_resp.json b/discovery/src/test/resources/discovery/v1/token_dict_status_resp.json deleted file mode 100644 index d6555602405..00000000000 --- a/discovery/src/test/resources/discovery/v1/token_dict_status_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "status" : "active", - "type" : "tokenization_dictionary" -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/token_dict_status_resp_stopwords.json b/discovery/src/test/resources/discovery/v1/token_dict_status_resp_stopwords.json deleted file mode 100644 index 1d08a5d7605..00000000000 --- a/discovery/src/test/resources/discovery/v1/token_dict_status_resp_stopwords.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "status" : "active", - "type" : "stopwords" -} \ No newline at end of file diff --git a/discovery/src/test/resources/discovery/v1/update_conf_resp.json b/discovery/src/test/resources/discovery/v1/update_conf_resp.json deleted file mode 100644 index 97ea6fdfb57..00000000000 --- a/discovery/src/test/resources/discovery/v1/update_conf_resp.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "name": "new-config", - "description": "this is an updated configuration", - "conversions": { - "word": { - "heading": { - "fonts": [ - { - "level": 1, - "min_size": 24, - "bold": false, - "italic": false - }, - { - "level": 2, - "min_size": 18, - "max_size": 23, - "bold": true, - "italic": false - }, - { - "level": 3, - "min_size": 14, - "max_size": 17, - "bold": false, - "italic": false - }, - { - "level": 4, - "min_size": 13, - "max_size": 13, - "bold": true, - "italic": false - } - ], - "styles": [ - { - "level": 1, - "names": [ - "pullout heading", - "pulloutheading", - "header" - ] - }, - { - "level": 2, - "names": [ - "subtitle" - ] - } - ] - } - }, - "pdf": { - "heading": { - "fonts": [ - { - "level": 1, - "min_size": 24, - "max_size": 80 - }, - { - "level": 2, - "min_size": 18, - "max_size": 24, - "bold": false, - "italic": false - }, - { - "level": 2, - "min_size": 18, - "max_size": 24, - "bold": true - }, - { - "level": 3, - "min_size": 13, - "max_size": 18, - "bold": false, - "italic": false - }, - { - "level": 3, - "min_size": 13, - "max_size": 18, - "bold": true - }, - { - "level": 4, - "min_size": 11, - "max_size": 13, - "bold": false, - "italic": false - } - ] - } - }, - "html": { - "exclude_tags_completely": [ - "script", - "sup" - ], - "exclude_tags_keep_content": [ - "font", - "em", - "span" - ], - "exclude_content": { - "xpaths": [] - }, - "keep_content": { - "xpaths": [] - }, - "exclude_tag_attributes": [ - "EVENT_ACTIONS" - ] - }, - "json_normalizations": [] - }, - "enrichments": [ - { - "destination_field": "enriched_text", - "source_field": "text", - "enrichment": "alchemy_language", - "options": { - "extract": [ - "keyword", - "entity", - "doc-sentiment", - "taxonomy", - "concept", - "relation" - ], - "sentiment": true, - "quotations": true - } - } - ] -} diff --git a/discovery/src/test/resources/discovery/v1/update_doc_resp.json b/discovery/src/test/resources/discovery/v1/update_doc_resp.json deleted file mode 100644 index bd8a195c28c..00000000000 --- a/discovery/src/test/resources/discovery/v1/update_doc_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "document_id": "8691f0dd-7181-45b7-81de-5cb16206b3a1", - "status": "available" -} diff --git a/discovery/src/test/resources/discovery/v1/update_env_resp.json b/discovery/src/test/resources/discovery/v1/update_env_resp.json deleted file mode 100644 index 7a7f7e9c186..00000000000 --- a/discovery/src/test/resources/discovery/v1/update_env_resp.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "environment_id": "9e21069a-8bc1-475e-a1d3-2121c49ef060", - "name": "Andrea_environment", - "description": "Dev environment for Andrea", - "created": "2016-12-13T17:42:23.067Z", - "updated": "2016-12-14T08:22:05.231Z", - "status": "available", - "index_capacity": { - "disk_usage": { - "used_bytes": 0, - "total_bytes": 1073741824, - "used": "0 KB", - "total": "1024 MB", - "percent_used": 0 - }, - "memory_usage": { - "used_bytes": 139035968, - "total_bytes": 518979584, - "used": "132.6 MB", - "total": "494.94 MB", - "percent_used": 26.79 - } - } -} diff --git a/discovery/src/test/resources/discovery/v1/update_training_example_resp.json b/discovery/src/test/resources/discovery/v1/update_training_example_resp.json deleted file mode 100644 index 68a65bd2934..00000000000 --- a/discovery/src/test/resources/discovery/v1/update_training_example_resp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "document_id": "mock_docid", - "relevance": 100 -} \ No newline at end of file diff --git a/ibm-watson/pom.xml b/ibm-watson/pom.xml index 86e0a49c65b..328f10acb34 100644 --- a/ibm-watson/pom.xml +++ b/ibm-watson/pom.xml @@ -35,12 +35,6 @@ ${project.version} compile - - com.ibm.watson - language-translator - ${project.version} - compile - com.ibm.watson natural-language-understanding diff --git a/language-translator/README.md b/language-translator/README.md deleted file mode 100644 index 47903f71f09..00000000000 --- a/language-translator/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Language Translator - -## Installation - -##### Maven - -```xml - - com.ibm.watson - language-translator - 13.0.0 - -``` - -##### Gradle - -```gradle -'com.ibm.watson:language-translator:13.0.0' -``` - -## Usage - -Select a domain, then identify or select the language of text, and then translate the text from one supported language to another. -Example: Translate 'hello' from English to Spanish using the [Language Translator][language_translator] service. - -```java -Authenticator authenticator = new IamAuthenticator(""); -LanguageTranslator service = new LanguageTranslator("2018-05-01", authenticator); - -TranslateOptions translateOptions = new TranslateOptions.Builder() - .addText("hello") - .source(Language.ENGLISH) - .target(Language.SPANISH) - .build(); -TranslationResult translationResult = service.translate(translateOptions).execute().getResult(); - -System.out.println(translationResult); -``` - -[language_translator]: https://cloud.ibm.com/docs/language-translator?topic=language-translator-about diff --git a/language-translator/pom.xml b/language-translator/pom.xml deleted file mode 100644 index 8a1805f6585..00000000000 --- a/language-translator/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - 4.0.0 - - - ibm-watson-parent - com.ibm.watson - 99-SNAPSHOT - ../pom.xml - - - language-translator - jar - IBM Watson Java SDK - Language Translator - - - - com.ibm.cloud - sdk-core - - - ${project.groupId} - common - compile - - - ${project.groupId} - common - test-jar - tests - test - - - org.testng - testng - test - - - com.squareup.okhttp3 - mockwebserver - test - - - org.powermock - powermock-api-mockito2 - test - - - org.powermock - powermock-module-testng - test - - - - - - Watson Developer Experience - watdevex@us.ibm.com - https://www.ibm.com/ - - - diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/LanguageTranslator.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/LanguageTranslator.java deleted file mode 100644 index b9acbe81d2c..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/LanguageTranslator.java +++ /dev/null @@ -1,722 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -/* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 - */ - -package com.ibm.watson.language_translator.v3; - -import com.google.gson.JsonObject; -import com.ibm.cloud.sdk.core.http.RequestBuilder; -import com.ibm.cloud.sdk.core.http.ResponseConverter; -import com.ibm.cloud.sdk.core.http.ServiceCall; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.ConfigBasedAuthenticatorFactory; -import com.ibm.cloud.sdk.core.service.BaseService; -import com.ibm.cloud.sdk.core.util.RequestUtils; -import com.ibm.cloud.sdk.core.util.ResponseConverterUtils; -import com.ibm.watson.common.SdkCommon; -import com.ibm.watson.language_translator.v3.model.CreateModelOptions; -import com.ibm.watson.language_translator.v3.model.DeleteDocumentOptions; -import com.ibm.watson.language_translator.v3.model.DeleteModelOptions; -import com.ibm.watson.language_translator.v3.model.DeleteModelResult; -import com.ibm.watson.language_translator.v3.model.DocumentList; -import com.ibm.watson.language_translator.v3.model.DocumentStatus; -import com.ibm.watson.language_translator.v3.model.GetDocumentStatusOptions; -import com.ibm.watson.language_translator.v3.model.GetModelOptions; -import com.ibm.watson.language_translator.v3.model.GetTranslatedDocumentOptions; -import com.ibm.watson.language_translator.v3.model.IdentifiableLanguages; -import com.ibm.watson.language_translator.v3.model.IdentifiedLanguages; -import com.ibm.watson.language_translator.v3.model.IdentifyOptions; -import com.ibm.watson.language_translator.v3.model.Languages; -import com.ibm.watson.language_translator.v3.model.ListDocumentsOptions; -import com.ibm.watson.language_translator.v3.model.ListIdentifiableLanguagesOptions; -import com.ibm.watson.language_translator.v3.model.ListLanguagesOptions; -import com.ibm.watson.language_translator.v3.model.ListModelsOptions; -import com.ibm.watson.language_translator.v3.model.TranslateDocumentOptions; -import com.ibm.watson.language_translator.v3.model.TranslateOptions; -import com.ibm.watson.language_translator.v3.model.TranslationModel; -import com.ibm.watson.language_translator.v3.model.TranslationModels; -import com.ibm.watson.language_translator.v3.model.TranslationResult; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import okhttp3.MultipartBody; - -/** - * IBM&reg; is announcing the deprecation of the Watson&reg; Language Translator service for - * IBM Cloud&reg; in all regions. As of 10 June 2023, the Language Translator tile will be - * removed from the IBM Cloud Platform for new customers; only existing customers will be able to - * access the product. As of 10 June 2024, the service will reach its End of Support date. As of 10 - * December 2024, the service will be withdrawn entirely and will no longer be available to any - * customers.{: deprecated} - * - *

IBM Watson&trade; Language Translator translates text from one language to another. The - * service offers multiple IBM-provided translation models that you can customize based on your - * unique terminology and language. Use Language Translator to take news from across the globe and - * present it in your language, communicate with your customers in their own language, and more. - * - *

API Version: 3.0.0 See: https://cloud.ibm.com/docs/language-translator - */ -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"; - - private String version; - - /** - * Constructs an instance of the `LanguageTranslator` client. The default service name is used to - * configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2018-05-01`. - */ - public LanguageTranslator(String version) { - this( - version, - DEFAULT_SERVICE_NAME, - ConfigBasedAuthenticatorFactory.getAuthenticator(DEFAULT_SERVICE_NAME)); - } - - /** - * Constructs an instance of the `LanguageTranslator` client. The default service name and - * specified authenticator are used to configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2018-05-01`. - * @param authenticator the {@link Authenticator} instance to be configured for this client - */ - public LanguageTranslator(String version, Authenticator authenticator) { - this(version, DEFAULT_SERVICE_NAME, authenticator); - } - - /** - * Constructs an instance of the `LanguageTranslator` client. The specified service name is used - * to configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2018-05-01`. - * @param serviceName the service name to be used when configuring the client instance - */ - public LanguageTranslator(String version, String serviceName) { - this(version, serviceName, ConfigBasedAuthenticatorFactory.getAuthenticator(serviceName)); - } - - /** - * Constructs an instance of the `LanguageTranslator` client. The specified service name and - * authenticator are used to configure the client instance. - * - * @param version Release date of the version of the API you want to use. Specify dates in - * YYYY-MM-DD format. The current version is `2018-05-01`. - * @param serviceName the service name to be used when configuring the client instance - * @param authenticator the {@link Authenticator} instance to be configured for this client - */ - public LanguageTranslator(String version, String serviceName, Authenticator authenticator) { - super(serviceName, authenticator); - setServiceUrl(DEFAULT_SERVICE_URL); - setVersion(version); - this.configureService(serviceName); - } - - /** - * Gets the version. - * - *

Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. - * The current version is `2018-05-01`. - * - * @return the version - */ - public String getVersion() { - return this.version; - } - - /** - * Sets the version. - * - * @param version the new version - */ - public void setVersion(final String version) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(version, "version cannot be empty."); - this.version = version; - } - - /** - * List supported languages. - * - *

Lists all supported languages for translation. The method returns an array of supported - * languages with information about each language. Languages are listed in alphabetical order by - * language code (for example, `af`, `ar`). In addition to basic information about each language, - * the response indicates whether the language is `supported_as_source` for translation and - * `supported_as_target` for translation. It also lists whether the language is `identifiable`. - * - * @param listLanguagesOptions the {@link ListLanguagesOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link Languages} - */ - public ServiceCall listLanguages(ListLanguagesOptions listLanguagesOptions) { - RequestBuilder builder = - RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/languages")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "listLanguages"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List supported languages. - * - *

Lists all supported languages for translation. The method returns an array of supported - * languages with information about each language. Languages are listed in alphabetical order by - * language code (for example, `af`, `ar`). In addition to basic information about each language, - * the response indicates whether the language is `supported_as_source` for translation and - * `supported_as_target` for translation. It also lists whether the language is `identifiable`. - * - * @return a {@link ServiceCall} with a result of type {@link Languages} - */ - public ServiceCall listLanguages() { - return listLanguages(null); - } - - /** - * Translate. - * - *

Translates the input text from the source language to the target language. Specify a model - * ID that indicates the source and target languages, or specify the source and target languages - * individually. You can omit the source language to have the service attempt to detect the - * language from the input text. If you omit the source language, the request must contain - * sufficient input text for the service to identify the source language. - * - *

You can translate a maximum of 50 KB (51,200 bytes) of text with a single request. All input - * text must be encoded in UTF-8 format. - * - * @param translateOptions the {@link TranslateOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link TranslationResult} - */ - public ServiceCall translate(TranslateOptions translateOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - translateOptions, "translateOptions cannot be null"); - RequestBuilder builder = - RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/translate")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "translate"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - final JsonObject contentJson = new JsonObject(); - contentJson.add( - "text", - com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(translateOptions.text())); - if (translateOptions.modelId() != null) { - contentJson.addProperty("model_id", translateOptions.modelId()); - } - if (translateOptions.source() != null) { - contentJson.addProperty("source", translateOptions.source()); - } - if (translateOptions.target() != null) { - contentJson.addProperty("target", translateOptions.target()); - } - builder.bodyJson(contentJson); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List identifiable languages. - * - *

Lists the languages that the service can identify. Returns the language code (for example, - * `en` for English or `es` for Spanish) and name of each language. - * - * @param listIdentifiableLanguagesOptions the {@link ListIdentifiableLanguagesOptions} containing - * the options for the call - * @return a {@link ServiceCall} with a result of type {@link IdentifiableLanguages} - */ - public ServiceCall listIdentifiableLanguages( - ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptions) { - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/identifiable_languages")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "listIdentifiableLanguages"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List identifiable languages. - * - *

Lists the languages that the service can identify. Returns the language code (for example, - * `en` for English or `es` for Spanish) and name of each language. - * - * @return a {@link ServiceCall} with a result of type {@link IdentifiableLanguages} - */ - public ServiceCall listIdentifiableLanguages() { - return listIdentifiableLanguages(null); - } - - /** - * Identify language. - * - *

Identifies the language of the input text. - * - * @param identifyOptions the {@link IdentifyOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link IdentifiedLanguages} - */ - public ServiceCall identify(IdentifyOptions identifyOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - identifyOptions, "identifyOptions cannot be null"); - RequestBuilder builder = - RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/identify")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "identify"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.bodyContent(identifyOptions.text(), "text/plain"); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List models. - * - *

Lists available translation models. - * - * @param listModelsOptions the {@link ListModelsOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link TranslationModels} - */ - public ServiceCall listModels(ListModelsOptions listModelsOptions) { - if (listModelsOptions == null) { - listModelsOptions = new ListModelsOptions.Builder().build(); - } - RequestBuilder builder = - RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/models")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "listModels"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - if (listModelsOptions.source() != null) { - builder.query("source", String.valueOf(listModelsOptions.source())); - } - if (listModelsOptions.target() != null) { - builder.query("target", String.valueOf(listModelsOptions.target())); - } - if (listModelsOptions.xDefault() != null) { - builder.query("default", String.valueOf(listModelsOptions.xDefault())); - } - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List models. - * - *

Lists available translation models. - * - * @return a {@link ServiceCall} with a result of type {@link TranslationModels} - */ - public ServiceCall listModels() { - return listModels(null); - } - - /** - * Create model. - * - *

Uploads training files to customize a translation model. You can customize a model with a - * forced glossary or with a parallel corpus: * Use a *forced glossary* to force certain terms and - * phrases to be translated in a specific way. You can upload only a single forced glossary file - * for a model. The size of a forced glossary file for a custom model is limited to 10 MB. * Use a - * *parallel corpus* when you want your custom model to learn from general translation patterns in - * parallel sentences in your samples. What your model learns from a parallel corpus can improve - * translation results for input text that the model has not been trained on. You can upload - * multiple parallel corpora files with a request. To successfully train with parallel corpora, - * the corpora files must contain a cumulative total of at least 5000 parallel sentences. The - * cumulative size of all uploaded corpus files for a custom model is limited to 250 MB. - * - *

Depending on the type of customization and the size of the uploaded files, training time can - * range from minutes for a glossary to several hours for a large parallel corpus. To create a - * model that is customized with a parallel corpus and a forced glossary, customize the model with - * a parallel corpus first and then customize the resulting model with a forced glossary. - * - *

You can create a maximum of 10 custom models per language pair. For more information about - * customizing a translation model, including the formatting and character restrictions for data - * files, see [Customizing your - * model](https://cloud.ibm.com/docs/language-translator?topic=language-translator-customizing). - * - *

#### Supported file formats - * - *

You can provide your training data for customization in the following document formats: * - * **TMX** (`.tmx`) - Translation Memory eXchange (TMX) is an XML specification for the exchange - * of translation memories. * **XLIFF** (`.xliff`) - XML Localization Interchange File Format - * (XLIFF) is an XML specification for the exchange of translation memories. * **CSV** (`.csv`) - - * Comma-separated values (CSV) file with two columns for aligned sentences and phrases. The first - * row must have two language codes. The first column is for the source language code, and the - * second column is for the target language code. * **TSV** (`.tsv` or `.tab`) - Tab-separated - * values (TSV) file with two columns for aligned sentences and phrases. The first row must have - * two language codes. The first column is for the source language code, and the second column is - * for the target language code. * **JSON** (`.json`) - Custom JSON format for specifying aligned - * sentences and phrases. * **Microsoft Excel** (`.xls` or `.xlsx`) - Excel file with the first - * two columns for aligned sentences and phrases. The first row contains the language code. - * - *

You must encode all text data in UTF-8 format. For more information, see [Supported document - * formats for training - * data](https://cloud.ibm.com/docs/language-translator?topic=language-translator-customizing#supported-document-formats-for-training-data). - * - *

#### Specifying file formats - * - *

You can indicate the format of a file by including the file extension with the file name. - * Use the file extensions shown in **Supported file formats**. - * - *

Alternatively, you can omit the file extension and specify one of the following - * `content-type` specifications for the file: * **TMX** - `application/x-tmx+xml` * **XLIFF** - - * `application/xliff+xml` * **CSV** - `text/csv` * **TSV** - `text/tab-separated-values` * - * **JSON** - `application/json` * **Microsoft Excel** - - * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - * - *

For example, with `curl`, use the following `content-type` specification to indicate the - * format of a CSV file named **glossary**: - * - *

`--form "forced_glossary=@glossary;type=text/csv"`. - * - * @param createModelOptions the {@link CreateModelOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link TranslationModel} - */ - public ServiceCall createModel(CreateModelOptions createModelOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - createModelOptions, "createModelOptions cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.isTrue( - (createModelOptions.forcedGlossary() != null) - || (createModelOptions.parallelCorpus() != null), - "At least one of forcedGlossary or parallelCorpus must be supplied."); - RequestBuilder builder = - RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/models")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "createModel"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - builder.query("base_model_id", String.valueOf(createModelOptions.baseModelId())); - if (createModelOptions.name() != null) { - builder.query("name", String.valueOf(createModelOptions.name())); - } - MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); - multipartBuilder.setType(MultipartBody.FORM); - if (createModelOptions.forcedGlossary() != null) { - okhttp3.RequestBody forcedGlossaryBody = - RequestUtils.inputStreamBody( - createModelOptions.forcedGlossary(), createModelOptions.forcedGlossaryContentType()); - multipartBuilder.addFormDataPart("forced_glossary", "filename", forcedGlossaryBody); - } - if (createModelOptions.parallelCorpus() != null) { - okhttp3.RequestBody parallelCorpusBody = - RequestUtils.inputStreamBody( - createModelOptions.parallelCorpus(), createModelOptions.parallelCorpusContentType()); - multipartBuilder.addFormDataPart("parallel_corpus", "filename", parallelCorpusBody); - } - builder.body(multipartBuilder.build()); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete model. - * - *

Deletes a custom translation model. - * - * @param deleteModelOptions the {@link DeleteModelOptions} containing the options for the call - * @return a {@link ServiceCall} with a result of type {@link DeleteModelResult} - */ - public ServiceCall deleteModel(DeleteModelOptions deleteModelOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteModelOptions, "deleteModelOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("model_id", deleteModelOptions.modelId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v3/models/{model_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "deleteModel"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get model details. - * - *

Gets information about a translation model, including training status for custom models. Use - * 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} - */ - public ServiceCall getModel(GetModelOptions getModelOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getModelOptions, "getModelOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("model_id", getModelOptions.modelId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v3/models/{model_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "getModel"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List documents. - * - *

Lists documents that have been submitted for translation. - * - * @param listDocumentsOptions the {@link ListDocumentsOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a result of type {@link DocumentList} - */ - public ServiceCall listDocuments(ListDocumentsOptions listDocumentsOptions) { - RequestBuilder builder = - RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/documents")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "listDocuments"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * List documents. - * - *

Lists documents that have been submitted for translation. - * - * @return a {@link ServiceCall} with a result of type {@link DocumentList} - */ - public ServiceCall listDocuments() { - return listDocuments(null); - } - - /** - * Translate document. - * - *

Submit a document for translation. You can submit the document contents in the `file` - * 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 - * - *

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. - * - *

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). - * - *

**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 - * submitted. - * - * @param translateDocumentOptions the {@link TranslateDocumentOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link DocumentStatus} - */ - public ServiceCall translateDocument( - TranslateDocumentOptions translateDocumentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - translateDocumentOptions, "translateDocumentOptions cannot be null"); - RequestBuilder builder = - RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/v3/documents")); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "translateDocument"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - MultipartBody.Builder multipartBuilder = new MultipartBody.Builder(); - multipartBuilder.setType(MultipartBody.FORM); - okhttp3.RequestBody fileBody = - RequestUtils.inputStreamBody( - translateDocumentOptions.file(), translateDocumentOptions.fileContentType()); - multipartBuilder.addFormDataPart("file", translateDocumentOptions.filename(), fileBody); - if (translateDocumentOptions.modelId() != null) { - multipartBuilder.addFormDataPart("model_id", translateDocumentOptions.modelId()); - } - if (translateDocumentOptions.source() != null) { - multipartBuilder.addFormDataPart("source", translateDocumentOptions.source()); - } - if (translateDocumentOptions.target() != null) { - multipartBuilder.addFormDataPart("target", translateDocumentOptions.target()); - } - if (translateDocumentOptions.documentId() != null) { - multipartBuilder.addFormDataPart("document_id", translateDocumentOptions.documentId()); - } - builder.body(multipartBuilder.build()); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get document status. - * - *

Gets the translation status of a document. - * - * @param getDocumentStatusOptions the {@link GetDocumentStatusOptions} containing the options for - * the call - * @return a {@link ServiceCall} with a result of type {@link DocumentStatus} - */ - public ServiceCall getDocumentStatus( - GetDocumentStatusOptions getDocumentStatusOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getDocumentStatusOptions, "getDocumentStatusOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("document_id", getDocumentStatusOptions.documentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v3/documents/{document_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "getDocumentStatus"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.header("Accept", "application/json"); - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = - ResponseConverterUtils.getValue( - new com.google.gson.reflect.TypeToken() {}.getType()); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Delete document. - * - *

Deletes a document. - * - * @param deleteDocumentOptions the {@link DeleteDocumentOptions} containing the options for the - * call - * @return a {@link ServiceCall} with a void result - */ - public ServiceCall deleteDocument(DeleteDocumentOptions deleteDocumentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - deleteDocumentOptions, "deleteDocumentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("document_id", deleteDocumentOptions.documentId()); - RequestBuilder builder = - RequestBuilder.delete( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v3/documents/{document_id}", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "deleteDocument"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getVoid(); - return createServiceCall(builder.build(), responseConverter); - } - - /** - * Get translated document. - * - *

Gets the translated document associated with the given document ID. - * - * @param getTranslatedDocumentOptions the {@link GetTranslatedDocumentOptions} containing the - * options for the call - * @return a {@link ServiceCall} with a result of type {@link InputStream} - */ - public ServiceCall getTranslatedDocument( - GetTranslatedDocumentOptions getTranslatedDocumentOptions) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - getTranslatedDocumentOptions, "getTranslatedDocumentOptions cannot be null"); - Map pathParamsMap = new HashMap(); - pathParamsMap.put("document_id", getTranslatedDocumentOptions.documentId()); - RequestBuilder builder = - RequestBuilder.get( - RequestBuilder.resolveRequestUrl( - getServiceUrl(), "/v3/documents/{document_id}/translated_document", pathParamsMap)); - Map sdkHeaders = - SdkCommon.getSdkHeaders("language_translator", "v3", "getTranslatedDocument"); - for (Entry header : sdkHeaders.entrySet()) { - builder.header(header.getKey(), header.getValue()); - } - if (getTranslatedDocumentOptions.accept() != null) { - builder.header("Accept", getTranslatedDocumentOptions.accept()); - } - builder.query("version", String.valueOf(this.version)); - ResponseConverter responseConverter = ResponseConverterUtils.getInputStream(); - return createServiceCall(builder.build(), responseConverter); - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/CreateModelOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/CreateModelOptions.java deleted file mode 100644 index fab1789835e..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/CreateModelOptions.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2018, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -/** The createModel options. */ -public class CreateModelOptions extends GenericModel { - - protected String baseModelId; - protected InputStream forcedGlossary; - protected String forcedGlossaryContentType; - protected InputStream parallelCorpus; - protected String parallelCorpusContentType; - protected String name; - - /** Builder. */ - public static class Builder { - private String baseModelId; - private InputStream forcedGlossary; - private String forcedGlossaryContentType; - private InputStream parallelCorpus; - 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; - this.forcedGlossaryContentType = createModelOptions.forcedGlossaryContentType; - this.parallelCorpus = createModelOptions.parallelCorpus; - this.parallelCorpusContentType = createModelOptions.parallelCorpusContentType; - this.name = createModelOptions.name; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param baseModelId the baseModelId - */ - public Builder(String baseModelId) { - this.baseModelId = baseModelId; - } - - /** - * Builds a CreateModelOptions. - * - * @return the new CreateModelOptions instance - */ - public CreateModelOptions build() { - return new CreateModelOptions(this); - } - - /** - * Set the baseModelId. - * - * @param baseModelId the baseModelId - * @return the CreateModelOptions builder - */ - public Builder baseModelId(String baseModelId) { - this.baseModelId = baseModelId; - return this; - } - - /** - * Set the forcedGlossary. - * - * @param forcedGlossary the forcedGlossary - * @return the CreateModelOptions builder - */ - public Builder forcedGlossary(InputStream forcedGlossary) { - this.forcedGlossary = forcedGlossary; - return this; - } - - /** - * Set the forcedGlossaryContentType. - * - * @param forcedGlossaryContentType the forcedGlossaryContentType - * @return the CreateModelOptions builder - */ - public Builder forcedGlossaryContentType(String forcedGlossaryContentType) { - this.forcedGlossaryContentType = forcedGlossaryContentType; - return this; - } - - /** - * Set the parallelCorpus. - * - * @param parallelCorpus the parallelCorpus - * @return the CreateModelOptions builder - */ - public Builder parallelCorpus(InputStream parallelCorpus) { - this.parallelCorpus = parallelCorpus; - return this; - } - - /** - * Set the parallelCorpusContentType. - * - * @param parallelCorpusContentType the parallelCorpusContentType - * @return the CreateModelOptions builder - */ - public Builder parallelCorpusContentType(String parallelCorpusContentType) { - this.parallelCorpusContentType = parallelCorpusContentType; - return this; - } - - /** - * Set the name. - * - * @param name the name - * @return the CreateModelOptions builder - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * Set the forcedGlossary. - * - * @param forcedGlossary the forcedGlossary - * @return the CreateModelOptions builder - * @throws FileNotFoundException if the file could not be found - */ - public Builder forcedGlossary(File forcedGlossary) throws FileNotFoundException { - this.forcedGlossary = new FileInputStream(forcedGlossary); - return this; - } - - /** - * Set the parallelCorpus. - * - * @param parallelCorpus the parallelCorpus - * @return the CreateModelOptions builder - * @throws FileNotFoundException if the file could not be found - */ - public Builder parallelCorpus(File parallelCorpus) throws FileNotFoundException { - this.parallelCorpus = new FileInputStream(parallelCorpus); - return this; - } - } - - protected CreateModelOptions() {} - - protected CreateModelOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull( - builder.baseModelId, "baseModelId cannot be null"); - baseModelId = builder.baseModelId; - forcedGlossary = builder.forcedGlossary; - forcedGlossaryContentType = builder.forcedGlossaryContentType; - parallelCorpus = builder.parallelCorpus; - parallelCorpusContentType = builder.parallelCorpusContentType; - name = builder.name; - } - - /** - * New builder. - * - * @return a CreateModelOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the baseModelId. - * - *

The ID of the translation model to use as the base for customization. To see available - * models and IDs, use the `List models` method. Most models that are provided with the service - * are customizable. In addition, all models that you create with parallel corpora customization - * can be further customized with a forced glossary. - * - * @return the baseModelId - */ - public String baseModelId() { - return baseModelId; - } - - /** - * Gets the forcedGlossary. - * - *

A file with forced glossary terms for the source and target languages. The customizations in - * the file completely overwrite the domain translation data, including high frequency or high - * confidence phrase translations. - * - *

You can upload only one glossary file for a custom model, and the glossary can have a - * maximum size of 10 MB. A forced glossary must contain single words or short phrases. For more - * information, see **Supported file formats** in the method description. - * - *

*With `curl`, use `--form forced_glossary=@{filename}`.*. - * - * @return the forcedGlossary - */ - public InputStream forcedGlossary() { - return forcedGlossary; - } - - /** - * Gets the forcedGlossaryContentType. - * - *

The content type of forcedGlossary. Values for this parameter can be obtained from the - * HttpMediaType class. - * - * @return the forcedGlossaryContentType - */ - public String forcedGlossaryContentType() { - return forcedGlossaryContentType; - } - - /** - * Gets the parallelCorpus. - * - *

A file with parallel sentences for the source and target languages. You can upload multiple - * parallel corpus files in one request by repeating the parameter. All uploaded parallel corpus - * files combined must contain at least 5000 parallel sentences to train successfully. You can - * provide a maximum of 500,000 parallel sentences across all corpora. - * - *

A single entry in a corpus file can contain a maximum of 80 words. All corpora files for a - * custom model can have a cumulative maximum size of 250 MB. For more information, see - * **Supported file formats** in the method description. - * - *

*With `curl`, use `--form parallel_corpus=@{filename}`.*. - * - * @return the parallelCorpus - */ - public InputStream parallelCorpus() { - return parallelCorpus; - } - - /** - * Gets the parallelCorpusContentType. - * - *

The content type of parallelCorpus. Values for this parameter can be obtained from the - * HttpMediaType class. - * - * @return the parallelCorpusContentType - */ - public String parallelCorpusContentType() { - return parallelCorpusContentType; - } - - /** - * Gets the name. - * - *

An optional model name that you can use to identify the model. Valid characters are letters, - * numbers, dashes, underscores, spaces, and apostrophes. The maximum length of the name is 32 - * characters. - * - * @return the name - */ - public String name() { - return name; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteDocumentOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteDocumentOptions.java deleted file mode 100644 index 735194b4b11..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteDocumentOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteDocument options. */ -public class DeleteDocumentOptions extends GenericModel { - - protected String documentId; - - /** Builder. */ - 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; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param documentId the documentId - */ - public Builder(String documentId) { - this.documentId = documentId; - } - - /** - * Builds a DeleteDocumentOptions. - * - * @return the new DeleteDocumentOptions instance - */ - public DeleteDocumentOptions build() { - return new DeleteDocumentOptions(this); - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the DeleteDocumentOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - } - - protected DeleteDocumentOptions() {} - - protected DeleteDocumentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.documentId, "documentId cannot be empty"); - documentId = builder.documentId; - } - - /** - * New builder. - * - * @return a DeleteDocumentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the documentId. - * - *

Document ID of the document to delete. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteModelOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteModelOptions.java deleted file mode 100644 index 33b8bd96051..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DeleteModelOptions.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The deleteModel options. */ -public class DeleteModelOptions extends GenericModel { - - protected String modelId; - - /** Builder. */ - 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; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param modelId the modelId - */ - public Builder(String modelId) { - this.modelId = modelId; - } - - /** - * Builds a DeleteModelOptions. - * - * @return the new DeleteModelOptions instance - */ - public DeleteModelOptions build() { - return new DeleteModelOptions(this); - } - - /** - * Set the modelId. - * - * @param modelId the modelId - * @return the DeleteModelOptions builder - */ - public Builder modelId(String modelId) { - this.modelId = modelId; - return this; - } - } - - protected DeleteModelOptions() {} - - protected DeleteModelOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.modelId, "modelId cannot be empty"); - modelId = builder.modelId; - } - - /** - * New builder. - * - * @return a DeleteModelOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the modelId. - * - *

Model ID of the model to delete. - * - * @return the modelId - */ - public String modelId() { - return modelId; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DocumentList.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DocumentList.java deleted file mode 100644 index f1e233a618c..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DocumentList.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** DocumentList. */ -public class DocumentList extends GenericModel { - - protected List documents; - - protected DocumentList() {} - - /** - * Gets the documents. - * - *

An array of all previously submitted documents. - * - * @return the documents - */ - public List getDocuments() { - return documents; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DocumentStatus.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DocumentStatus.java deleted file mode 100644 index ef929366d12..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/DocumentStatus.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.Date; - -/** Document information, including translation status. */ -public class DocumentStatus extends GenericModel { - - /** The status of the translation job associated with a submitted document. */ - public interface Status { - /** processing. */ - String PROCESSING = "processing"; - /** available. */ - String AVAILABLE = "available"; - /** failed. */ - String FAILED = "failed"; - } - - @SerializedName("document_id") - protected String documentId; - - protected String filename; - protected String status; - - @SerializedName("model_id") - protected String modelId; - - @SerializedName("base_model_id") - protected String baseModelId; - - protected String source; - - @SerializedName("detected_language_confidence") - protected Double detectedLanguageConfidence; - - protected String target; - protected Date created; - protected Date completed; - - @SerializedName("word_count") - protected Long wordCount; - - @SerializedName("character_count") - protected Long characterCount; - - protected DocumentStatus() {} - - /** - * Gets the documentId. - * - *

System generated ID identifying a document being translated using one specific translation - * model. - * - * @return the documentId - */ - public String getDocumentId() { - return documentId; - } - - /** - * Gets the filename. - * - *

filename from the submission (if it was missing in the multipart-form, 'noname.<ext - * matching content type>' is used. - * - * @return the filename - */ - public String getFilename() { - return filename; - } - - /** - * Gets the status. - * - *

The status of the translation job associated with a submitted document. - * - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * Gets the modelId. - * - *

A globally unique string that identifies the underlying model that is used for translation. - * - * @return the modelId - */ - public String getModelId() { - return modelId; - } - - /** - * Gets the baseModelId. - * - *

Model ID of the base model that was used to customize the model. If the model is not a - * custom model, this will be absent or an empty string. - * - * @return the baseModelId - */ - public String getBaseModelId() { - return baseModelId; - } - - /** - * Gets the source. - * - *

Translation source language code. - * - * @return the source - */ - public String getSource() { - return source; - } - - /** - * Gets the detectedLanguageConfidence. - * - *

A score between 0 and 1 indicating the confidence of source language detection. A higher - * value indicates greater confidence. This is returned only when the service automatically - * detects the source language. - * - * @return the detectedLanguageConfidence - */ - public Double getDetectedLanguageConfidence() { - return detectedLanguageConfidence; - } - - /** - * Gets the target. - * - *

Translation target language code. - * - * @return the target - */ - public String getTarget() { - return target; - } - - /** - * Gets the created. - * - *

The time when the document was submitted. - * - * @return the created - */ - public Date getCreated() { - return created; - } - - /** - * Gets the completed. - * - *

The time when the translation completed. - * - * @return the completed - */ - public Date getCompleted() { - return completed; - } - - /** - * Gets the wordCount. - * - *

An estimate of the number of words in the source document. Returned only if `status` is - * `available`. - * - * @return the wordCount - */ - public Long getWordCount() { - return wordCount; - } - - /** - * Gets the characterCount. - * - *

The number of characters in the source document, present only if status=available. - * - * @return the characterCount - */ - public Long getCharacterCount() { - return characterCount; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetDocumentStatusOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetDocumentStatusOptions.java deleted file mode 100644 index 28a18bf4bb4..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetDocumentStatusOptions.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getDocumentStatus options. */ -public class GetDocumentStatusOptions extends GenericModel { - - protected String documentId; - - /** Builder. */ - 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; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param documentId the documentId - */ - public Builder(String documentId) { - this.documentId = documentId; - } - - /** - * Builds a GetDocumentStatusOptions. - * - * @return the new GetDocumentStatusOptions instance - */ - public GetDocumentStatusOptions build() { - return new GetDocumentStatusOptions(this); - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the GetDocumentStatusOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - } - - protected GetDocumentStatusOptions() {} - - protected GetDocumentStatusOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.documentId, "documentId cannot be empty"); - documentId = builder.documentId; - } - - /** - * New builder. - * - * @return a GetDocumentStatusOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the documentId. - * - *

The document ID of the document. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetModelOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetModelOptions.java deleted file mode 100644 index c29a416744f..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetModelOptions.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getModel options. */ -public class GetModelOptions extends GenericModel { - - protected String modelId; - - /** Builder. */ - 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; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param modelId the modelId - */ - public Builder(String modelId) { - this.modelId = modelId; - } - - /** - * Builds a GetModelOptions. - * - * @return the new GetModelOptions instance - */ - public GetModelOptions build() { - return new GetModelOptions(this); - } - - /** - * Set the modelId. - * - * @param modelId the modelId - * @return the GetModelOptions builder - */ - public Builder modelId(String modelId) { - this.modelId = modelId; - return this; - } - } - - protected GetModelOptions() {} - - protected GetModelOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.modelId, "modelId cannot be empty"); - modelId = builder.modelId; - } - - /** - * New builder. - * - * @return a GetModelOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the modelId. - * - *

Model ID of the model to get. - * - * @return the modelId - */ - public String modelId() { - return modelId; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetTranslatedDocumentOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetTranslatedDocumentOptions.java deleted file mode 100644 index 30606bcb9ea..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/GetTranslatedDocumentOptions.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The getTranslatedDocument options. */ -public class GetTranslatedDocumentOptions extends GenericModel { - - protected String documentId; - protected String accept; - - /** Builder. */ - 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; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param documentId the documentId - */ - public Builder(String documentId) { - this.documentId = documentId; - } - - /** - * Builds a GetTranslatedDocumentOptions. - * - * @return the new GetTranslatedDocumentOptions instance - */ - public GetTranslatedDocumentOptions build() { - return new GetTranslatedDocumentOptions(this); - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the GetTranslatedDocumentOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - - /** - * Set the accept. - * - * @param accept the accept - * @return the GetTranslatedDocumentOptions builder - */ - public Builder accept(String accept) { - this.accept = accept; - return this; - } - } - - protected GetTranslatedDocumentOptions() {} - - protected GetTranslatedDocumentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notEmpty( - builder.documentId, "documentId cannot be empty"); - documentId = builder.documentId; - accept = builder.accept; - } - - /** - * New builder. - * - * @return a GetTranslatedDocumentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the documentId. - * - *

The document ID of the document that was submitted for translation. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } - - /** - * Gets the accept. - * - *

The type of the response: application/powerpoint, application/mspowerpoint, - * application/x-rtf, application/json, application/xml, application/vnd.ms-excel, - * application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, - * application/vnd.ms-powerpoint, - * application/vnd.openxmlformats-officedocument.presentationml.presentation, application/msword, - * application/vnd.openxmlformats-officedocument.wordprocessingml.document, - * application/vnd.oasis.opendocument.spreadsheet, - * application/vnd.oasis.opendocument.presentation, application/vnd.oasis.opendocument.text, - * application/pdf, application/rtf, text/html, text/json, text/plain, text/richtext, text/rtf, or - * text/xml. A character encoding can be specified by including a `charset` parameter. For - * example, 'text/html;charset=utf-8'. - * - * @return the accept - */ - public String accept() { - return accept; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguages.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguages.java deleted file mode 100644 index 53199ac63d6..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguages.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** IdentifiableLanguages. */ -public class IdentifiableLanguages extends GenericModel { - - protected List languages; - - protected IdentifiableLanguages() {} - - /** - * Gets the languages. - * - *

A list of all languages that the service can identify. - * - * @return the languages - */ - public List getLanguages() { - return languages; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguage.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguage.java deleted file mode 100644 index cdf44f13fde..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguage.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** IdentifiedLanguage. */ -public class IdentifiedLanguage extends GenericModel { - - protected String language; - protected Double confidence; - - protected IdentifiedLanguage() {} - - /** - * Gets the language. - * - *

The language code for an identified language. - * - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * Gets the confidence. - * - *

The confidence score for the identified language. - * - * @return the confidence - */ - public Double getConfidence() { - return confidence; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguages.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguages.java deleted file mode 100644 index da41f7e4a75..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguages.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** IdentifiedLanguages. */ -public class IdentifiedLanguages extends GenericModel { - - protected List languages; - - protected IdentifiedLanguages() {} - - /** - * Gets the languages. - * - *

A ranking of identified languages with confidence scores. - * - * @return the languages - */ - public List getLanguages() { - return languages; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifyOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifyOptions.java deleted file mode 100644 index a766036f9e1..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/IdentifyOptions.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The identify options. */ -public class IdentifyOptions extends GenericModel { - - protected String text; - - /** Builder. */ - 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; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param text the text - */ - public Builder(String text) { - this.text = text; - } - - /** - * Builds a IdentifyOptions. - * - * @return the new IdentifyOptions instance - */ - public IdentifyOptions build() { - return new IdentifyOptions(this); - } - - /** - * Set the text. - * - * @param text the text - * @return the IdentifyOptions builder - */ - public Builder text(String text) { - this.text = text; - return this; - } - } - - protected IdentifyOptions() {} - - protected IdentifyOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.text, "text cannot be null"); - text = builder.text; - } - - /** - * New builder. - * - * @return a IdentifyOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the text. - * - *

Input text in UTF-8 format. - * - * @return the text - */ - public String text() { - return text; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Language.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Language.java deleted file mode 100644 index c2874d5026a..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Language.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Response payload for languages. */ -public class Language extends GenericModel { - - protected String language; - - @SerializedName("language_name") - protected String languageName; - - @SerializedName("native_language_name") - protected String nativeLanguageName; - - @SerializedName("country_code") - protected String countryCode; - - @SerializedName("words_separated") - protected Boolean wordsSeparated; - - protected String direction; - - @SerializedName("supported_as_source") - protected Boolean supportedAsSource; - - @SerializedName("supported_as_target") - protected Boolean supportedAsTarget; - - protected Boolean identifiable; - - protected Language() {} - - /** - * Gets the language. - * - *

The language code for the language (for example, `af`). - * - * @return the language - */ - public String getLanguage() { - return language; - } - - /** - * Gets the languageName. - * - *

The name of the language in English (for example, `Afrikaans`). - * - * @return the languageName - */ - public String getLanguageName() { - return languageName; - } - - /** - * Gets the nativeLanguageName. - * - *

The native name of the language (for example, `Afrikaans`). - * - * @return the nativeLanguageName - */ - public String getNativeLanguageName() { - return nativeLanguageName; - } - - /** - * Gets the countryCode. - * - *

The country code for the language (for example, `ZA` for South Africa). - * - * @return the countryCode - */ - public String getCountryCode() { - return countryCode; - } - - /** - * Gets the wordsSeparated. - * - *

Indicates whether words of the language are separated by whitespace: `true` if the words are - * separated; `false` otherwise. - * - * @return the wordsSeparated - */ - public Boolean isWordsSeparated() { - return wordsSeparated; - } - - /** - * Gets the direction. - * - *

Indicates the direction of the language: `right_to_left` or `left_to_right`. - * - * @return the direction - */ - public String getDirection() { - return direction; - } - - /** - * Gets the supportedAsSource. - * - *

Indicates whether the language can be used as the source for translation: `true` if the - * language can be used as the source; `false` otherwise. - * - * @return the supportedAsSource - */ - public Boolean isSupportedAsSource() { - return supportedAsSource; - } - - /** - * Gets the supportedAsTarget. - * - *

Indicates whether the language can be used as the target for translation: `true` if the - * language can be used as the target; `false` otherwise. - * - * @return the supportedAsTarget - */ - public Boolean isSupportedAsTarget() { - return supportedAsTarget; - } - - /** - * Gets the identifiable. - * - *

Indicates whether the language supports automatic detection: `true` if the language can be - * detected automatically; `false` otherwise. - * - * @return the identifiable - */ - public Boolean isIdentifiable() { - return identifiable; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Languages.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Languages.java deleted file mode 100644 index d1c5f2746d0..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/Languages.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** The response type for listing supported languages. */ -public class Languages extends GenericModel { - - protected List languages; - - protected Languages() {} - - /** - * Gets the languages. - * - *

An array of supported languages with information about each language. - * - * @return the languages - */ - public List getLanguages() { - return languages; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListDocumentsOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListDocumentsOptions.java deleted file mode 100644 index 7129f9b7800..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListDocumentsOptions.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listDocuments options. */ -public class ListDocumentsOptions extends GenericModel { - - /** Construct a new instance of ListDocumentsOptions. */ - public ListDocumentsOptions() {} -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListIdentifiableLanguagesOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListIdentifiableLanguagesOptions.java deleted file mode 100644 index 23d7ed51d4b..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListIdentifiableLanguagesOptions.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listIdentifiableLanguages options. */ -public class ListIdentifiableLanguagesOptions extends GenericModel { - - /** Construct a new instance of ListIdentifiableLanguagesOptions. */ - public ListIdentifiableLanguagesOptions() {} -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListLanguagesOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListLanguagesOptions.java deleted file mode 100644 index 80def04b53e..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListLanguagesOptions.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listLanguages options. */ -public class ListLanguagesOptions extends GenericModel { - - /** Construct a new instance of ListLanguagesOptions. */ - public ListLanguagesOptions() {} -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListModelsOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListModelsOptions.java deleted file mode 100644 index 841c6434097..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/ListModelsOptions.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** The listModels options. */ -public class ListModelsOptions extends GenericModel { - - protected String source; - protected String target; - protected Boolean xDefault; - - /** Builder. */ - public static class Builder { - private String source; - private String target; - private Boolean xDefault; - - /** - * Instantiates a new Builder from an existing ListModelsOptions instance. - * - * @param listModelsOptions the instance to initialize the Builder with - */ - private Builder(ListModelsOptions listModelsOptions) { - this.source = listModelsOptions.source; - this.target = listModelsOptions.target; - this.xDefault = listModelsOptions.xDefault; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Builds a ListModelsOptions. - * - * @return the new ListModelsOptions instance - */ - public ListModelsOptions build() { - return new ListModelsOptions(this); - } - - /** - * Set the source. - * - * @param source the source - * @return the ListModelsOptions builder - */ - public Builder source(String source) { - this.source = source; - return this; - } - - /** - * Set the target. - * - * @param target the target - * @return the ListModelsOptions builder - */ - public Builder target(String target) { - this.target = target; - return this; - } - - /** - * Set the xDefault. - * - * @param xDefault the xDefault - * @return the ListModelsOptions builder - */ - public Builder xDefault(Boolean xDefault) { - this.xDefault = xDefault; - return this; - } - } - - protected ListModelsOptions() {} - - protected ListModelsOptions(Builder builder) { - source = builder.source; - target = builder.target; - xDefault = builder.xDefault; - } - - /** - * New builder. - * - * @return a ListModelsOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the source. - * - *

Specify a language code to filter results by source language. - * - * @return the source - */ - public String source() { - return source; - } - - /** - * Gets the target. - * - *

Specify a language code to filter results by target language. - * - * @return the target - */ - public String target() { - return target; - } - - /** - * Gets the xDefault. - * - *

If the `default` parameter isn't specified, the service returns all models (default and - * non-default) for each language pair. To return only default models, set this parameter to - * `true`. To return only non-default models, set this parameter to `false`. There is exactly one - * default model, the IBM-provided base model, per language pair. - * - * @return the xDefault - */ - public Boolean xDefault() { - return xDefault; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslateDocumentOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslateDocumentOptions.java deleted file mode 100644 index 9072adf9cad..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslateDocumentOptions.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -/** The translateDocument options. */ -public class TranslateDocumentOptions extends GenericModel { - - protected InputStream file; - protected String filename; - protected String fileContentType; - protected String modelId; - protected String source; - protected String target; - protected String documentId; - - /** Builder. */ - public static class Builder { - private InputStream file; - private String filename; - private String fileContentType; - private String modelId; - private String source; - private String target; - private String documentId; - - /** - * Instantiates a new Builder from an existing TranslateDocumentOptions instance. - * - * @param translateDocumentOptions the instance to initialize the Builder with - */ - private Builder(TranslateDocumentOptions translateDocumentOptions) { - this.file = translateDocumentOptions.file; - this.filename = translateDocumentOptions.filename; - this.fileContentType = translateDocumentOptions.fileContentType; - this.modelId = translateDocumentOptions.modelId; - this.source = translateDocumentOptions.source; - this.target = translateDocumentOptions.target; - this.documentId = translateDocumentOptions.documentId; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param file the file - * @param filename the filename - */ - public Builder(InputStream file, String filename) { - this.file = file; - this.filename = filename; - } - - /** - * Builds a TranslateDocumentOptions. - * - * @return the new TranslateDocumentOptions instance - */ - public TranslateDocumentOptions build() { - return new TranslateDocumentOptions(this); - } - - /** - * Set the file. - * - * @param file the file - * @return the TranslateDocumentOptions builder - */ - public Builder file(InputStream file) { - this.file = file; - return this; - } - - /** - * Set the filename. - * - * @param filename the filename - * @return the TranslateDocumentOptions builder - */ - public Builder filename(String filename) { - this.filename = filename; - return this; - } - - /** - * Set the fileContentType. - * - * @param fileContentType the fileContentType - * @return the TranslateDocumentOptions builder - */ - public Builder fileContentType(String fileContentType) { - this.fileContentType = fileContentType; - return this; - } - - /** - * Set the modelId. - * - * @param modelId the modelId - * @return the TranslateDocumentOptions builder - */ - public Builder modelId(String modelId) { - this.modelId = modelId; - return this; - } - - /** - * Set the source. - * - * @param source the source - * @return the TranslateDocumentOptions builder - */ - public Builder source(String source) { - this.source = source; - return this; - } - - /** - * Set the target. - * - * @param target the target - * @return the TranslateDocumentOptions builder - */ - public Builder target(String target) { - this.target = target; - return this; - } - - /** - * Set the documentId. - * - * @param documentId the documentId - * @return the TranslateDocumentOptions builder - */ - public Builder documentId(String documentId) { - this.documentId = documentId; - return this; - } - - /** - * Set the file. - * - * @param file the file - * @return the TranslateDocumentOptions builder - * @throws FileNotFoundException if the file could not be found - */ - public Builder file(File file) throws FileNotFoundException { - this.file = new FileInputStream(file); - this.filename = file.getName(); - return this; - } - } - - protected TranslateDocumentOptions() {} - - protected TranslateDocumentOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.file, "file cannot be null"); - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.filename, "filename cannot be null"); - file = builder.file; - filename = builder.filename; - fileContentType = builder.fileContentType; - modelId = builder.modelId; - source = builder.source; - target = builder.target; - documentId = builder.documentId; - } - - /** - * New builder. - * - * @return a TranslateDocumentOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the file. - * - *

The contents of the source file to translate. 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 - * - *

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. - * - *

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). - * - * @return the file - */ - public InputStream file() { - return file; - } - - /** - * Gets the filename. - * - *

The filename for file. - * - * @return the filename - */ - public String filename() { - return filename; - } - - /** - * Gets the fileContentType. - * - *

The content type of file. Values for this parameter can be obtained from the HttpMediaType - * class. - * - * @return the fileContentType - */ - public String fileContentType() { - return fileContentType; - } - - /** - * Gets the modelId. - * - *

The model to use for translation. For example, `en-de` selects the IBM-provided base model - * for English-to-German translation. A model ID overrides the `source` and `target` parameters - * and is required if you use a custom model. If no model ID is specified, you must specify at - * least a target language. - * - * @return the modelId - */ - public String modelId() { - return modelId; - } - - /** - * Gets the source. - * - *

Language code that specifies the language of the source document. If omitted, the service - * derives the source language from the input text. The input must contain sufficient text for the - * service to identify the language reliably. - * - * @return the source - */ - public String source() { - return source; - } - - /** - * Gets the target. - * - *

Language code that specifies the target language for translation. Required if model ID is - * not specified. - * - * @return the target - */ - public String target() { - return target; - } - - /** - * Gets the documentId. - * - *

To use a previously submitted document as the source for a new translation, enter the - * `document_id` of the document. - * - * @return the documentId - */ - public String documentId() { - return documentId; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslateOptions.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslateOptions.java deleted file mode 100644 index c599d7dd733..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslateOptions.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.ArrayList; -import java.util.List; - -/** The translate options. */ -public class TranslateOptions extends GenericModel { - - protected List text; - protected String modelId; - protected String source; - protected String target; - - /** Builder. */ - public static class Builder { - private List text; - private String modelId; - private String source; - private String target; - - /** - * Instantiates a new Builder from an existing TranslateOptions instance. - * - * @param translateOptions the instance to initialize the Builder with - */ - private Builder(TranslateOptions translateOptions) { - this.text = translateOptions.text; - this.modelId = translateOptions.modelId; - this.source = translateOptions.source; - this.target = translateOptions.target; - } - - /** Instantiates a new builder. */ - public Builder() {} - - /** - * Instantiates a new builder with required properties. - * - * @param text the text - */ - public Builder(List text) { - this.text = text; - } - - /** - * Builds a TranslateOptions. - * - * @return the new TranslateOptions instance - */ - public TranslateOptions build() { - return new TranslateOptions(this); - } - - /** - * Adds a new element to text. - * - * @param text the new element to be added - * @return the TranslateOptions builder - */ - public Builder addText(String text) { - com.ibm.cloud.sdk.core.util.Validator.notNull(text, "text cannot be null"); - if (this.text == null) { - this.text = new ArrayList(); - } - this.text.add(text); - return this; - } - - /** - * Set the text. Existing text will be replaced. - * - * @param text the text - * @return the TranslateOptions builder - */ - public Builder text(List text) { - this.text = text; - return this; - } - - /** - * Set the modelId. - * - * @param modelId the modelId - * @return the TranslateOptions builder - */ - public Builder modelId(String modelId) { - this.modelId = modelId; - return this; - } - - /** - * Set the source. - * - * @param source the source - * @return the TranslateOptions builder - */ - public Builder source(String source) { - this.source = source; - return this; - } - - /** - * Set the target. - * - * @param target the target - * @return the TranslateOptions builder - */ - public Builder target(String target) { - this.target = target; - return this; - } - } - - protected TranslateOptions() {} - - protected TranslateOptions(Builder builder) { - com.ibm.cloud.sdk.core.util.Validator.notNull(builder.text, "text cannot be null"); - text = builder.text; - modelId = builder.modelId; - source = builder.source; - target = builder.target; - } - - /** - * New builder. - * - * @return a TranslateOptions builder - */ - public Builder newBuilder() { - return new Builder(this); - } - - /** - * Gets the text. - * - *

Input text in UTF-8 encoding. Submit a maximum of 50 KB (51,200 bytes) of text with a single - * request. Multiple elements result in multiple translations in the response. - * - * @return the text - */ - public List text() { - return text; - } - - /** - * Gets the modelId. - * - *

The model to use for translation. For example, `en-de` selects the IBM-provided base model - * for English-to-German translation. A model ID overrides the `source` and `target` parameters - * and is required if you use a custom model. If no model ID is specified, you must specify at - * least a target language. - * - * @return the modelId - */ - public String modelId() { - return modelId; - } - - /** - * Gets the source. - * - *

Language code that specifies the language of the input text. If omitted, the service derives - * the source language from the input text. The input must contain sufficient text for the service - * to identify the language reliably. - * - * @return the source - */ - public String source() { - return source; - } - - /** - * Gets the target. - * - *

Language code that specifies the target language for translation. Required if model ID is - * not specified. - * - * @return the target - */ - public String target() { - return target; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationModel.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationModel.java deleted file mode 100644 index b8f6295b184..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationModel.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2016, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; - -/** Response payload for models. */ -public class TranslationModel extends GenericModel { - - /** Availability of a model. */ - public interface Status { - /** uploading. */ - String UPLOADING = "uploading"; - /** uploaded. */ - String UPLOADED = "uploaded"; - /** dispatching. */ - String DISPATCHING = "dispatching"; - /** queued. */ - String QUEUED = "queued"; - /** training. */ - String TRAINING = "training"; - /** trained. */ - String TRAINED = "trained"; - /** publishing. */ - String PUBLISHING = "publishing"; - /** available. */ - String AVAILABLE = "available"; - /** deleted. */ - String DELETED = "deleted"; - /** error. */ - String ERROR = "error"; - } - - @SerializedName("model_id") - protected String modelId; - - protected String name; - protected String source; - protected String target; - - @SerializedName("base_model_id") - protected String baseModelId; - - protected String domain; - protected Boolean customizable; - - @SerializedName("default_model") - protected Boolean defaultModel; - - protected String owner; - protected String status; - - protected TranslationModel() {} - - /** - * Gets the modelId. - * - *

A globally unique string that identifies the underlying model that is used for translation. - * - * @return the modelId - */ - public String getModelId() { - return modelId; - } - - /** - * Gets the name. - * - *

Optional name that can be specified when the model is created. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Gets the source. - * - *

Translation source language code. - * - * @return the source - */ - public String getSource() { - return source; - } - - /** - * Gets the target. - * - *

Translation target language code. - * - * @return the target - */ - public String getTarget() { - return target; - } - - /** - * Gets the baseModelId. - * - *

Model ID of the base model that was used to customize the model. If the model is not a - * custom model, this will be an empty string. - * - * @return the baseModelId - */ - public String getBaseModelId() { - return baseModelId; - } - - /** - * Gets the domain. - * - *

The domain of the translation model. - * - * @return the domain - */ - public String getDomain() { - return domain; - } - - /** - * Gets the customizable. - * - *

Whether this model can be used as a base for customization. Customized models are not - * further customizable, and some base models are not customizable. - * - * @return the customizable - */ - public Boolean isCustomizable() { - return customizable; - } - - /** - * Gets the defaultModel. - * - *

Whether or not the model is a default model. A default model is the model for a given - * language pair that will be used when that language pair is specified in the source and target - * parameters. - * - * @return the defaultModel - */ - public Boolean isDefaultModel() { - return defaultModel; - } - - /** - * Gets the owner. - * - *

Either an empty string, indicating the model is not a custom model, or the ID of the service - * instance that created the model. - * - * @return the owner - */ - public String getOwner() { - return owner; - } - - /** - * Gets the status. - * - *

Availability of a model. - * - * @return the status - */ - public String getStatus() { - return status; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationModels.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationModels.java deleted file mode 100644 index f72206c0490..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationModels.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** The response type for listing existing translation models. */ -public class TranslationModels extends GenericModel { - - protected List models; - - protected TranslationModels() {} - - /** - * Gets the models. - * - *

An array of available models. - * - * @return the models - */ - public List getModels() { - return models; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationResult.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationResult.java deleted file mode 100644 index e6caed531d0..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/model/TranslationResult.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2016, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.model; - -import com.google.gson.annotations.SerializedName; -import com.ibm.cloud.sdk.core.service.model.GenericModel; -import java.util.List; - -/** TranslationResult. */ -public class TranslationResult extends GenericModel { - - @SerializedName("word_count") - protected Long wordCount; - - @SerializedName("character_count") - protected Long characterCount; - - @SerializedName("detected_language") - protected String detectedLanguage; - - @SerializedName("detected_language_confidence") - protected Double detectedLanguageConfidence; - - protected List translations; - - protected TranslationResult() {} - - /** - * Gets the wordCount. - * - *

An estimate of the number of words in the input text. - * - * @return the wordCount - */ - public Long getWordCount() { - return wordCount; - } - - /** - * Gets the characterCount. - * - *

Number of characters in the input text. - * - * @return the characterCount - */ - public Long getCharacterCount() { - return characterCount; - } - - /** - * Gets the detectedLanguage. - * - *

The language code of the source text if the source language was automatically detected. - * - * @return the detectedLanguage - */ - public String getDetectedLanguage() { - return detectedLanguage; - } - - /** - * Gets the detectedLanguageConfidence. - * - *

A score between 0 and 1 indicating the confidence of source language detection. A higher - * value indicates greater confidence. This is returned only when the service automatically - * detects the source language. - * - * @return the detectedLanguageConfidence - */ - public Double getDetectedLanguageConfidence() { - return detectedLanguageConfidence; - } - - /** - * Gets the translations. - * - *

List of translation output in UTF-8, corresponding to the input text entries. - * - * @return the translations - */ - public List getTranslations() { - return translations; - } -} diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/package-info.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/package-info.java deleted file mode 100644 index e7520c0f03d..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/package-info.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -/** Language Translator v3. */ -package com.ibm.watson.language_translator.v3; diff --git a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/util/Language.java b/language-translator/src/main/java/com/ibm/watson/language_translator/v3/util/Language.java deleted file mode 100644 index 6142fa18d16..00000000000 --- a/language-translator/src/main/java/com/ibm/watson/language_translator/v3/util/Language.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2017, 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.util; - -import com.ibm.watson.language_translator.v3.LanguageTranslator; - -/** The languages available in {@link LanguageTranslator}. */ -public interface Language { - /** Afrikaans. */ - String AFRIKAANS = "af"; - - /** Arabic. */ - String ARABIC = "ar"; - - /** Azerbaijani. */ - String AZERBAIJANI = "az"; - - /** Bashkir. */ - String BASHKIR = "ba"; - - /** Belarusian. */ - String BELARUSIAN = "be"; - - /** Bulgarian. */ - String BULGARIAN = "bg"; - - /** Bengali. */ - String BENGALI = "bn"; - - /** Bosnian. */ - String BOSNIAN = "bs"; - - /** Czech. */ - String CZECH = "cs"; - - /** Chuvash. */ - String CHUVASH = "cv"; - - /** Danish. */ - String DANISH = "da"; - - /** German. */ - String GERMAN = "de"; - - /** Greek. */ - String GREEK = "el"; - - /** English. */ - String ENGLISH = "en"; - - /** Esperanto. */ - String ESPERANTO = "eo"; - - /** Spanish. */ - String SPANISH = "es"; - - /** Estonian. */ - String ESTONIAN = "et"; - - /** Basque. */ - String BASQUE = "eu"; - - /** Persian. */ - String PERSIAN = "fa"; - - /** Finnish. */ - String FINNISH = "fi"; - - /** French. */ - String FRENCH = "fr"; - - /** Gujarati. */ - String GUJARATI = "gu"; - - /** Hebrew. */ - String HEBREW = "he"; - - /** Hindi. */ - String HINDI = "hi"; - - /** Haitian. */ - String HAITIAN = "ht"; - - /** Hungarian. */ - String HUNGARIAN = "hu"; - - /** Armenian. */ - String ARMENIAN = "hy"; - - /** Indonesian. */ - String INDONESIAN = "id"; - - /** Icelandic. */ - String ICELANDIC = "is"; - - /** Italian. */ - String ITALIAN = "it"; - - /** Japanese. */ - String JAPANESE = "ja"; - - /** Georgian. */ - String GEORGIAN = "ka"; - - /** Kazakh. */ - String KAZAKH = "kk"; - - /** Central Khmer. */ - String CENTRAL_KHMER = "km"; - - /** Korean. */ - String KOREAN = "ko"; - - /** Kurdish. */ - String KURDISH = "ku"; - - /** Kirghiz. */ - String KIRGHIZ = "ky"; - - /** Lithuanian. */ - String LITHUANIAN = "lt"; - - /** Latvian. */ - String LATVIAN = "lv"; - - /** Malayalam. */ - String MALAYALAM = "ml"; - - /** Mongolian. */ - String MONGOLIAN = "mn"; - - /** Norwegian Bokmal. */ - String NORWEGIAN_BOKMAL = "nb"; - - /** Dutch. */ - String DUTCH = "nl"; - - /** Norwegian Nynorsk. */ - String NORWEGIAN_NYNORSK = "nn"; - - /** Panjabi. */ - String PANJABI = "pa"; - - /** Polish. */ - String POLISH = "pl"; - - /** Pushto. */ - String PUSHTO = "ps"; - - /** Portuguese. */ - String PORTUGUESE = "pt"; - - /** Romanian. */ - String ROMANIAN = "ro"; - - /** Russian. */ - String RUSSIAN = "ru"; - - /** Slovakian. */ - String SLOVAKIAN = "sk"; - - /** Somali. */ - String SOMALI = "so"; - - /** Albanian. */ - String ALBANIAN = "sq"; - - /** Swedish. */ - String SWEDISH = "sv"; - - /** Tamil. */ - String TAMIL = "ta"; - - /** Telugu. */ - String TELUGU = "te"; - - /** Turkish. */ - String TURKISH = "tr"; - - /** Ukrainian. */ - String UKRAINIAN = "uk"; - - /** Urdu. */ - String URDU = "ur"; - - /** Vietnamese. */ - String VIETNAMESE = "vi"; - - /** Chinese. */ - String CHINESE = "zh"; - - /** Traditional Chinese. */ - String TRADITIONAL_CHINESE = "zh-TW"; -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/LanguageTranslatorIT.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/LanguageTranslatorIT.java deleted file mode 100644 index 8b8d32a1a03..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/LanguageTranslatorIT.java +++ /dev/null @@ -1,301 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 2024. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -import com.ibm.cloud.sdk.core.http.HttpMediaType; -import com.ibm.cloud.sdk.core.http.Response; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.IamAuthenticator; -import com.ibm.cloud.sdk.core.service.exception.TooManyRequestsException; -import com.ibm.watson.common.WatsonHttpHeaders; -import com.ibm.watson.common.WatsonServiceTest; -import com.ibm.watson.language_translator.v3.model.*; -import com.ibm.watson.language_translator.v3.util.Language; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; - -/** Language Translator integration test. */ -public class LanguageTranslatorIT extends WatsonServiceTest { - - private static final String ENGLISH_TO_SPANISH = "en-es"; - - private LanguageTranslator service; - - private final Map translations = - new HashMap() { - { - put("The IBM Watson team is awesome", "El equipo de IBM Watson es impresionante"); - put("Welcome to the cognitive era", "Bienvenido a la era cognitiva"); - } - }; - private final List texts = new ArrayList<>(translations.keySet()); - - /** - * Sets up the tests. - * - * @throws Exception the exception - */ - /* - * (non-Javadoc) - * @see com.ibm.watson.developercloud.WatsonServiceTest#setUp() - */ - @Override - @Before - public void setUp() throws Exception { - super.setUp(); - String iamApiKey = System.getenv("LANGUAGE_TRANSLATOR_APIKEY"); - String serviceUrl = System.getenv("LANGUAGE_TRANSLATOR_URL"); - - if (iamApiKey == null) { - iamApiKey = getProperty("language_translator.apikey"); - serviceUrl = getProperty("language_translator.url"); - } - - assertNotNull( - "LANGUAGE_TRANSLATOR_APIKEY is not defined and config.properties doesn't have valid credentials.", - iamApiKey); - - Authenticator authenticator = new IamAuthenticator(iamApiKey); - service = new LanguageTranslator("2018-05-01", authenticator); - service.setServiceUrl(serviceUrl); - - // issue currently where document translation fails with learning opt-out - Map headers = new HashMap<>(); - headers.put(WatsonHttpHeaders.X_WATSON_TEST, "1"); - service.setDefaultHeaders(headers); - } - - /** - * Test README. - * - * @throws InterruptedException the interrupted exception - * @throws IOException Signals that an I/O exception has occurred. - */ - @Test - public void testReadme() throws InterruptedException, IOException { - TranslateOptions translateOptions = - new TranslateOptions.Builder() - .addText("hello") - .source(Language.ENGLISH) - .target(Language.SPANISH) - .build(); - Response translationResult = service.translate(translateOptions).execute(); - - System.out.println(translationResult); - } - - /** Test Get Identifiable languages. */ - @Test - public void testGetIdentifiableLanguages() { - List languages = - service.listIdentifiableLanguages().execute().getResult().getLanguages(); - assertNotNull(languages); - assertTrue(!languages.isEmpty()); - } - - /** Test Get model by id. */ - @Test - public void testGetModel() { - GetModelOptions getOptions = new GetModelOptions.Builder(ENGLISH_TO_SPANISH).build(); - try { - final Response model = service.getModel(getOptions).execute(); - assertNotNull(model); - } catch (TooManyRequestsException e) { - // The service seems to have a very strict rate limit. Failing this way is okay. - } - } - - /** Test List Models. */ - @Test - public void testListModels() { - try { - List models = service.listModels(null).execute().getResult().getModels(); - - assertNotNull(models); - assertFalse(models.isEmpty()); - } catch (TooManyRequestsException e) { - // The service seems to have a very strict rate limit. Failing this way is okay. - } - } - - /** Test List Models with Options. */ - @Test - public void testListModelsWithOptions() { - try { - ListModelsOptions options = - new ListModelsOptions.Builder().source("en").target("es").xDefault(true).build(); - List models = service.listModels(options).execute().getResult().getModels(); - - assertNotNull(models); - assertFalse(models.isEmpty()); - assertEquals(models.get(0).getSource(), options.source()); - assertEquals(models.get(0).getTarget(), options.target()); - } catch (TooManyRequestsException e) { - // The service seems to have a very strict rate limit. Failing this way is okay. - } - } - - /** Test Identify. */ - @Test - public void testIdentify() { - - IdentifyOptions options = new IdentifyOptions.Builder(texts.get(0)).build(); - List identifiedLanguages = - service.identify(options).execute().getResult().getLanguages(); - assertNotNull(identifiedLanguages); - assertFalse(identifiedLanguages.isEmpty()); - } - - /** Test translate. */ - @Test - public void testTranslate() { - for (String text : texts) { - TranslateOptions options = - new TranslateOptions.Builder().addText(text).modelId(ENGLISH_TO_SPANISH).build(); - testTranslationResult( - text, translations.get(text), service.translate(options).execute().getResult()); - TranslateOptions options1 = - new TranslateOptions.Builder() - .addText(text) - .source(Language.ENGLISH) - .target(Language.SPANISH) - .build(); - testTranslationResult( - text, translations.get(text), service.translate(options1).execute().getResult()); - } - } - - /** Test translate multiple. */ - @Test - public void testTranslateMultiple() { - TranslateOptions options = - new TranslateOptions.Builder(texts).modelId(ENGLISH_TO_SPANISH).build(); - TranslationResult results = service.translate(options).execute().getResult(); - assertEquals(2, results.getTranslations().size()); - assertEquals(translations.get(texts.get(0)), results.getTranslations().get(0).getTranslation()); - assertEquals(translations.get(texts.get(1)), results.getTranslations().get(1).getTranslation()); - - TranslateOptions.Builder builder = new TranslateOptions.Builder(); - builder.source(Language.ENGLISH).target(Language.SPANISH); - for (String text : texts) { - builder.addText(text); - } - results = service.translate(builder.build()).execute().getResult(); - assertEquals(2, results.getTranslations().size()); - assertEquals(translations.get(texts.get(0)), results.getTranslations().get(0).getTranslation()); - assertEquals(translations.get(texts.get(1)), results.getTranslations().get(1).getTranslation()); - } - - /** Test delete all models. */ - @Test - @Ignore - public void testDeleteAllModels() { - List models = service.listModels(null).execute().getResult().getModels(); - for (TranslationModel translationModel : models) { - DeleteModelOptions options = - new DeleteModelOptions.Builder(translationModel.getModelId()).build(); - service.deleteModel(options).execute(); - } - } - - /** - * Test document translation. - * - * @throws FileNotFoundException the file not found exception - * @throws InterruptedException the interrupted exception - */ - @Test - public void testDocumentTranslation() throws FileNotFoundException, InterruptedException { - DocumentList listResponse = service.listDocuments().execute().getResult(); - int originalDocumentCount = listResponse.getDocuments().size(); - - TranslateDocumentOptions translateOptions = - new TranslateDocumentOptions.Builder() - .file(new File("src/test/resources/language_translation/document_to_translate.txt")) - .fileContentType(HttpMediaType.TEXT_PLAIN) - .source("en") - .target("es") - .build(); - DocumentStatus translateResponse = - service.translateDocument(translateOptions).execute().getResult(); - String documentId = translateResponse.getDocumentId(); - - try { - GetDocumentStatusOptions getOptions = - new GetDocumentStatusOptions.Builder().documentId(documentId).build(); - DocumentStatus getResponse = service.getDocumentStatus(getOptions).execute().getResult(); - while (!getResponse.getStatus().equals(DocumentStatus.Status.AVAILABLE)) { - Thread.sleep(3000); - getResponse = service.getDocumentStatus(getOptions).execute().getResult(); - } - - GetTranslatedDocumentOptions getTranslatedDocumentOptions = - new GetTranslatedDocumentOptions.Builder() - .documentId(documentId) - .accept(HttpMediaType.TEXT_PLAIN) - .build(); - InputStream getTranslatedDocumentResponse = - service.getTranslatedDocument(getTranslatedDocumentOptions).execute().getResult(); - assertNotNull(getTranslatedDocumentResponse); - - listResponse = service.listDocuments().execute().getResult(); - assertTrue(listResponse.getDocuments().size() > originalDocumentCount); - } finally { - DeleteDocumentOptions deleteOptions = - new DeleteDocumentOptions.Builder().documentId(documentId).build(); - service.deleteDocument(deleteOptions).execute().getResult(); - } - } - - /** - * Test translation result. - * - * @param text the text - * @param result the result - * @param translationResult the translation result - */ - private void testTranslationResult( - String text, String result, TranslationResult translationResult) { - assertNotNull(translationResult); - assertEquals(translationResult.getCharacterCount().intValue(), text.length()); - assertEquals(translationResult.getWordCount().intValue(), text.split(" ").length); - assertNotNull(translationResult.getTranslations()); - assertNotNull(translationResult.getTranslations().get(0).getTranslation()); - assertEquals(result, translationResult.getTranslations().get(0).getTranslation()); - } - - /** Test List Languages. */ - @Test - public void testListLanguages_Success() { - ListLanguagesOptions listLanguagesOptions = new ListLanguagesOptions(); - Languages response = service.listLanguages(listLanguagesOptions).execute().getResult(); - - assertNotNull(response); - assertNotNull(response.getLanguages()); - assertTrue(response.getLanguages().size() > 0); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/LanguageTranslatorTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/LanguageTranslatorTest.java deleted file mode 100644 index dc954cd295c..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/LanguageTranslatorTest.java +++ /dev/null @@ -1,813 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2019, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.http.Response; -import com.ibm.cloud.sdk.core.security.Authenticator; -import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.model.CreateModelOptions; -import com.ibm.watson.language_translator.v3.model.DeleteDocumentOptions; -import com.ibm.watson.language_translator.v3.model.DeleteModelOptions; -import com.ibm.watson.language_translator.v3.model.DeleteModelResult; -import com.ibm.watson.language_translator.v3.model.DocumentList; -import com.ibm.watson.language_translator.v3.model.DocumentStatus; -import com.ibm.watson.language_translator.v3.model.GetDocumentStatusOptions; -import com.ibm.watson.language_translator.v3.model.GetModelOptions; -import com.ibm.watson.language_translator.v3.model.GetTranslatedDocumentOptions; -import com.ibm.watson.language_translator.v3.model.IdentifiableLanguages; -import com.ibm.watson.language_translator.v3.model.IdentifiedLanguages; -import com.ibm.watson.language_translator.v3.model.IdentifyOptions; -import com.ibm.watson.language_translator.v3.model.Languages; -import com.ibm.watson.language_translator.v3.model.ListDocumentsOptions; -import com.ibm.watson.language_translator.v3.model.ListIdentifiableLanguagesOptions; -import com.ibm.watson.language_translator.v3.model.ListLanguagesOptions; -import com.ibm.watson.language_translator.v3.model.ListModelsOptions; -import com.ibm.watson.language_translator.v3.model.TranslateDocumentOptions; -import com.ibm.watson.language_translator.v3.model.TranslateOptions; -import com.ibm.watson.language_translator.v3.model.TranslationModel; -import com.ibm.watson.language_translator.v3.model.TranslationModels; -import com.ibm.watson.language_translator.v3.model.TranslationResult; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; -import okhttp3.mockwebserver.RecordedRequest; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -/** Unit test class for the LanguageTranslator service. */ -public class LanguageTranslatorTest { - - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - protected MockWebServer server; - protected LanguageTranslator languageTranslatorService; - - // Construct the service with a null authenticator (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testConstructorWithNullAuthenticator() throws Throwable { - final String serviceName = "testService"; - // Set mock values for global params - String version = "2018-05-01"; - new LanguageTranslator(version, serviceName, null); - } - - // Test the getter for the version global parameter - @Test - public void testGetVersion() throws Throwable { - assertEquals(languageTranslatorService.getVersion(), "2018-05-01"); - } - - // Test the listLanguages operation with a valid options model parameter - @Test - public void testListLanguagesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"languages\": [{\"language\": \"language\", \"language_name\": \"languageName\", \"native_language_name\": \"nativeLanguageName\", \"country_code\": \"countryCode\", \"words_separated\": true, \"direction\": \"direction\", \"supported_as_source\": false, \"supported_as_target\": false, \"identifiable\": true}]}"; - String listLanguagesPath = "/v3/languages"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListLanguagesOptions model - ListLanguagesOptions listLanguagesOptionsModel = new ListLanguagesOptions(); - - // Invoke listLanguages() with a valid options model and verify the result - Response response = - languageTranslatorService.listLanguages(listLanguagesOptionsModel).execute(); - assertNotNull(response); - Languages responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listLanguagesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the listLanguages operation with and without retries enabled - @Test - public void testListLanguagesWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testListLanguagesWOptions(); - - languageTranslatorService.disableRetries(); - testListLanguagesWOptions(); - } - - // Test the translate operation with a valid options model parameter - @Test - public void testTranslateWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"word_count\": 9, \"character_count\": 14, \"detected_language\": \"detectedLanguage\", \"detected_language_confidence\": 0, \"translations\": [{\"translation\": \"translation\"}]}"; - String translatePath = "/v3/translate"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the TranslateOptions model - TranslateOptions translateOptionsModel = - new TranslateOptions.Builder() - .text(java.util.Arrays.asList("testString")) - .modelId("testString") - .source("testString") - .target("testString") - .build(); - - // Invoke translate() with a valid options model and verify the result - Response response = - languageTranslatorService.translate(translateOptionsModel).execute(); - assertNotNull(response); - TranslationResult responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, translatePath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the translate operation with and without retries enabled - @Test - public void testTranslateWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testTranslateWOptions(); - - languageTranslatorService.disableRetries(); - testTranslateWOptions(); - } - - // Test the translate operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTranslateNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.translate(null).execute(); - } - - // Test the listIdentifiableLanguages operation with a valid options model parameter - @Test - public void testListIdentifiableLanguagesWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"languages\": [{\"language\": \"language\", \"name\": \"name\"}]}"; - String listIdentifiableLanguagesPath = "/v3/identifiable_languages"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListIdentifiableLanguagesOptions model - ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptionsModel = - new ListIdentifiableLanguagesOptions(); - - // Invoke listIdentifiableLanguages() with a valid options model and verify the result - Response response = - languageTranslatorService - .listIdentifiableLanguages(listIdentifiableLanguagesOptionsModel) - .execute(); - assertNotNull(response); - IdentifiableLanguages responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listIdentifiableLanguagesPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the listIdentifiableLanguages operation with and without retries enabled - @Test - public void testListIdentifiableLanguagesWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testListIdentifiableLanguagesWOptions(); - - languageTranslatorService.disableRetries(); - testListIdentifiableLanguagesWOptions(); - } - - // Test the identify operation with a valid options model parameter - @Test - public void testIdentifyWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"languages\": [{\"language\": \"language\", \"confidence\": 0}]}"; - String identifyPath = "/v3/identify"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the IdentifyOptions model - IdentifyOptions identifyOptionsModel = new IdentifyOptions.Builder().text("testString").build(); - - // Invoke identify() with a valid options model and verify the result - Response response = - languageTranslatorService.identify(identifyOptionsModel).execute(); - assertNotNull(response); - IdentifiedLanguages responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, identifyPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the identify operation with and without retries enabled - @Test - public void testIdentifyWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testIdentifyWOptions(); - - languageTranslatorService.disableRetries(); - testIdentifyWOptions(); - } - - // Test the identify operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testIdentifyNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.identify(null).execute(); - } - - // Test the listModels operation with a valid options model parameter - @Test - public void testListModelsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"models\": [{\"model_id\": \"modelId\", \"name\": \"name\", \"source\": \"source\", \"target\": \"target\", \"base_model_id\": \"baseModelId\", \"domain\": \"domain\", \"customizable\": true, \"default_model\": true, \"owner\": \"owner\", \"status\": \"uploading\"}]}"; - String listModelsPath = "/v3/models"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListModelsOptions model - ListModelsOptions listModelsOptionsModel = - new ListModelsOptions.Builder() - .source("testString") - .target("testString") - .xDefault(true) - .build(); - - // Invoke listModels() with a valid options model and verify the result - Response response = - languageTranslatorService.listModels(listModelsOptionsModel).execute(); - assertNotNull(response); - TranslationModels responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listModelsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - assertEquals(query.get("source"), "testString"); - assertEquals(query.get("target"), "testString"); - assertEquals(Boolean.valueOf(query.get("default")), Boolean.valueOf(true)); - } - - // Test the listModels operation with and without retries enabled - @Test - public void testListModelsWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testListModelsWOptions(); - - languageTranslatorService.disableRetries(); - testListModelsWOptions(); - } - - // Test the createModel operation with a valid options model parameter - @Test - public void testCreateModelWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"model_id\": \"modelId\", \"name\": \"name\", \"source\": \"source\", \"target\": \"target\", \"base_model_id\": \"baseModelId\", \"domain\": \"domain\", \"customizable\": true, \"default_model\": true, \"owner\": \"owner\", \"status\": \"uploading\"}"; - String createModelPath = "/v3/models"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the CreateModelOptions model - CreateModelOptions createModelOptionsModel = - new CreateModelOptions.Builder() - .baseModelId("testString") - .forcedGlossary(TestUtilities.createMockStream("This is a mock file.")) - .forcedGlossaryContentType("application/x-tmx+xml") - .parallelCorpus(TestUtilities.createMockStream("This is a mock file.")) - .parallelCorpusContentType("application/x-tmx+xml") - .name("testString") - .build(); - - // Invoke createModel() with a valid options model and verify the result - Response response = - languageTranslatorService.createModel(createModelOptionsModel).execute(); - assertNotNull(response); - TranslationModel responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, createModelPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - assertEquals(query.get("base_model_id"), "testString"); - assertEquals(query.get("name"), "testString"); - } - - // Test the createModel operation with and without retries enabled - @Test - public void testCreateModelWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testCreateModelWOptions(); - - languageTranslatorService.disableRetries(); - testCreateModelWOptions(); - } - - // Test the createModel operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateModelNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.createModel(null).execute(); - } - - // Test the deleteModel operation with a valid options model parameter - @Test - public void testDeleteModelWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "{\"status\": \"status\"}"; - String deleteModelPath = "/v3/models/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the DeleteModelOptions model - DeleteModelOptions deleteModelOptionsModel = - new DeleteModelOptions.Builder().modelId("testString").build(); - - // Invoke deleteModel() with a valid options model and verify the result - Response response = - languageTranslatorService.deleteModel(deleteModelOptionsModel).execute(); - assertNotNull(response); - DeleteModelResult responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteModelPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the deleteModel operation with and without retries enabled - @Test - public void testDeleteModelWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testDeleteModelWOptions(); - - languageTranslatorService.disableRetries(); - testDeleteModelWOptions(); - } - - // Test the deleteModel operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteModelNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.deleteModel(null).execute(); - } - - // Test the getModel operation with a valid options model parameter - @Test - public void testGetModelWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"model_id\": \"modelId\", \"name\": \"name\", \"source\": \"source\", \"target\": \"target\", \"base_model_id\": \"baseModelId\", \"domain\": \"domain\", \"customizable\": true, \"default_model\": true, \"owner\": \"owner\", \"status\": \"uploading\"}"; - String getModelPath = "/v3/models/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetModelOptions model - GetModelOptions getModelOptionsModel = - new GetModelOptions.Builder().modelId("testString").build(); - - // Invoke getModel() with a valid options model and verify the result - Response response = - languageTranslatorService.getModel(getModelOptionsModel).execute(); - assertNotNull(response); - TranslationModel responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getModelPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the getModel operation with and without retries enabled - @Test - public void testGetModelWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testGetModelWOptions(); - - languageTranslatorService.disableRetries(); - testGetModelWOptions(); - } - - // Test the getModel operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetModelNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.getModel(null).execute(); - } - - // Test the listDocuments operation with a valid options model parameter - @Test - public void testListDocumentsWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"documents\": [{\"document_id\": \"documentId\", \"filename\": \"filename\", \"status\": \"processing\", \"model_id\": \"modelId\", \"base_model_id\": \"baseModelId\", \"source\": \"source\", \"detected_language_confidence\": 0, \"target\": \"target\", \"created\": \"2019-01-01T12:00:00.000Z\", \"completed\": \"2019-01-01T12:00:00.000Z\", \"word_count\": 9, \"character_count\": 14}]}"; - String listDocumentsPath = "/v3/documents"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the ListDocumentsOptions model - ListDocumentsOptions listDocumentsOptionsModel = new ListDocumentsOptions(); - - // Invoke listDocuments() with a valid options model and verify the result - Response response = - languageTranslatorService.listDocuments(listDocumentsOptionsModel).execute(); - assertNotNull(response); - DocumentList responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, listDocumentsPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the listDocuments operation with and without retries enabled - @Test - public void testListDocumentsWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testListDocumentsWOptions(); - - languageTranslatorService.disableRetries(); - testListDocumentsWOptions(); - } - - // Test the translateDocument operation with a valid options model parameter - @Test - public void testTranslateDocumentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"filename\": \"filename\", \"status\": \"processing\", \"model_id\": \"modelId\", \"base_model_id\": \"baseModelId\", \"source\": \"source\", \"detected_language_confidence\": 0, \"target\": \"target\", \"created\": \"2019-01-01T12:00:00.000Z\", \"completed\": \"2019-01-01T12:00:00.000Z\", \"word_count\": 9, \"character_count\": 14}"; - String translateDocumentPath = "/v3/documents"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(202) - .setBody(mockResponseBody)); - - // Construct an instance of the TranslateDocumentOptions model - TranslateDocumentOptions translateDocumentOptionsModel = - new TranslateDocumentOptions.Builder() - .file(TestUtilities.createMockStream("This is a mock file.")) - .filename("testString") - .fileContentType("application/mspowerpoint") - .modelId("testString") - .source("testString") - .target("testString") - .documentId("testString") - .build(); - - // Invoke translateDocument() with a valid options model and verify the result - Response response = - languageTranslatorService.translateDocument(translateDocumentOptionsModel).execute(); - assertNotNull(response); - DocumentStatus responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "POST"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, translateDocumentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the translateDocument operation with and without retries enabled - @Test - public void testTranslateDocumentWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testTranslateDocumentWOptions(); - - languageTranslatorService.disableRetries(); - testTranslateDocumentWOptions(); - } - - // Test the translateDocument operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTranslateDocumentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.translateDocument(null).execute(); - } - - // Test the getDocumentStatus operation with a valid options model parameter - @Test - public void testGetDocumentStatusWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = - "{\"document_id\": \"documentId\", \"filename\": \"filename\", \"status\": \"processing\", \"model_id\": \"modelId\", \"base_model_id\": \"baseModelId\", \"source\": \"source\", \"detected_language_confidence\": 0, \"target\": \"target\", \"created\": \"2019-01-01T12:00:00.000Z\", \"completed\": \"2019-01-01T12:00:00.000Z\", \"word_count\": 9, \"character_count\": 14}"; - String getDocumentStatusPath = "/v3/documents/testString"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/json") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetDocumentStatusOptions model - GetDocumentStatusOptions getDocumentStatusOptionsModel = - new GetDocumentStatusOptions.Builder().documentId("testString").build(); - - // Invoke getDocumentStatus() with a valid options model and verify the result - Response response = - languageTranslatorService.getDocumentStatus(getDocumentStatusOptionsModel).execute(); - assertNotNull(response); - DocumentStatus responseObj = response.getResult(); - assertNotNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getDocumentStatusPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the getDocumentStatus operation with and without retries enabled - @Test - public void testGetDocumentStatusWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testGetDocumentStatusWOptions(); - - languageTranslatorService.disableRetries(); - testGetDocumentStatusWOptions(); - } - - // Test the getDocumentStatus operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDocumentStatusNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.getDocumentStatus(null).execute(); - } - - // Test the deleteDocument operation with a valid options model parameter - @Test - public void testDeleteDocumentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = ""; - String deleteDocumentPath = "/v3/documents/testString"; - server.enqueue(new MockResponse().setResponseCode(204).setBody(mockResponseBody)); - - // Construct an instance of the DeleteDocumentOptions model - DeleteDocumentOptions deleteDocumentOptionsModel = - new DeleteDocumentOptions.Builder().documentId("testString").build(); - - // Invoke deleteDocument() with a valid options model and verify the result - Response response = - languageTranslatorService.deleteDocument(deleteDocumentOptionsModel).execute(); - assertNotNull(response); - Void responseObj = response.getResult(); - assertNull(responseObj); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "DELETE"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, deleteDocumentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the deleteDocument operation with and without retries enabled - @Test - public void testDeleteDocumentWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testDeleteDocumentWOptions(); - - languageTranslatorService.disableRetries(); - testDeleteDocumentWOptions(); - } - - // Test the deleteDocument operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteDocumentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.deleteDocument(null).execute(); - } - - // Test the getTranslatedDocument operation with a valid options model parameter - @Test - public void testGetTranslatedDocumentWOptions() throws Throwable { - // Register a mock response - String mockResponseBody = "This is a mock binary response."; - String getTranslatedDocumentPath = "/v3/documents/testString/translated_document"; - server.enqueue( - new MockResponse() - .setHeader("Content-type", "application/powerpoint") - .setResponseCode(200) - .setBody(mockResponseBody)); - - // Construct an instance of the GetTranslatedDocumentOptions model - GetTranslatedDocumentOptions getTranslatedDocumentOptionsModel = - new GetTranslatedDocumentOptions.Builder() - .documentId("testString") - .accept("application/powerpoint") - .build(); - - // Invoke getTranslatedDocument() with a valid options model and verify the result - Response response = - languageTranslatorService - .getTranslatedDocument(getTranslatedDocumentOptionsModel) - .execute(); - assertNotNull(response); - InputStream responseObj = response.getResult(); - assertNotNull(responseObj); - responseObj.close(); - - // Verify the contents of the request sent to the mock server - RecordedRequest request = server.takeRequest(); - assertNotNull(request); - assertEquals(request.getMethod(), "GET"); - // Verify request path - String parsedPath = TestUtilities.parseReqPath(request); - assertEquals(parsedPath, getTranslatedDocumentPath); - // Verify query params - Map query = TestUtilities.parseQueryString(request); - assertNotNull(query); - assertEquals(query.get("version"), "2018-05-01"); - } - - // Test the getTranslatedDocument operation with and without retries enabled - @Test - public void testGetTranslatedDocumentWRetries() throws Throwable { - languageTranslatorService.enableRetries(4, 30); - testGetTranslatedDocumentWOptions(); - - languageTranslatorService.disableRetries(); - testGetTranslatedDocumentWOptions(); - } - - // Test the getTranslatedDocument operation with a null options model (negative test) - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetTranslatedDocumentNoOptions() throws Throwable { - server.enqueue(new MockResponse()); - languageTranslatorService.getTranslatedDocument(null).execute(); - } - - // Perform setup needed before each test method - @BeforeMethod - public void beforeEachTest() { - // Start the mock server. - try { - server = new MockWebServer(); - server.start(); - } catch (IOException err) { - fail("Failed to instantiate mock web server"); - } - - // Construct an instance of the service - constructClientService(); - } - - // Perform tear down after each test method - @AfterMethod - public void afterEachTest() throws IOException { - server.shutdown(); - languageTranslatorService = null; - } - - // Constructs an instance of the service to be used by the tests - public void constructClientService() { - final String serviceName = "testService"; - // set mock values for global params - String version = "2018-05-01"; - - final Authenticator authenticator = new NoAuthAuthenticator(); - languageTranslatorService = new LanguageTranslator(version, serviceName, authenticator); - String url = server.url("/").toString(); - languageTranslatorService.setServiceUrl(url); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/CreateModelOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/CreateModelOptionsTest.java deleted file mode 100644 index 58b3eddb34b..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/CreateModelOptionsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.apache.commons.io.IOUtils; -import org.testng.annotations.Test; - -/** Unit test class for the CreateModelOptions model. */ -public class CreateModelOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testCreateModelOptions() throws Throwable { - CreateModelOptions createModelOptionsModel = - new CreateModelOptions.Builder() - .baseModelId("testString") - .forcedGlossary(TestUtilities.createMockStream("This is a mock file.")) - .forcedGlossaryContentType("application/x-tmx+xml") - .parallelCorpus(TestUtilities.createMockStream("This is a mock file.")) - .parallelCorpusContentType("application/x-tmx+xml") - .name("testString") - .build(); - assertEquals(createModelOptionsModel.baseModelId(), "testString"); - assertEquals( - IOUtils.toString(createModelOptionsModel.forcedGlossary()), - IOUtils.toString(TestUtilities.createMockStream("This is a mock file."))); - assertEquals(createModelOptionsModel.forcedGlossaryContentType(), "application/x-tmx+xml"); - assertEquals( - IOUtils.toString(createModelOptionsModel.parallelCorpus()), - IOUtils.toString(TestUtilities.createMockStream("This is a mock file."))); - assertEquals(createModelOptionsModel.parallelCorpusContentType(), "application/x-tmx+xml"); - assertEquals(createModelOptionsModel.name(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testCreateModelOptionsError() throws Throwable { - new CreateModelOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteModelOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteModelOptionsTest.java deleted file mode 100644 index 02782fd12c4..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteModelOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteModelOptions model. */ -public class DeleteModelOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteModelOptions() throws Throwable { - DeleteModelOptions deleteModelOptionsModel = - new DeleteModelOptions.Builder().modelId("testString").build(); - assertEquals(deleteModelOptionsModel.modelId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testDeleteModelOptionsError() throws Throwable { - new DeleteModelOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteModelResultTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteModelResultTest.java deleted file mode 100644 index 8537d3643c5..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DeleteModelResultTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DeleteModelResult model. */ -public class DeleteModelResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDeleteModelResult() throws Throwable { - DeleteModelResult deleteModelResultModel = new DeleteModelResult(); - assertNull(deleteModelResultModel.getStatus()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DocumentListTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DocumentListTest.java deleted file mode 100644 index 1cac44e874f..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DocumentListTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DocumentList model. */ -public class DocumentListTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDocumentList() throws Throwable { - DocumentList documentListModel = new DocumentList(); - assertNull(documentListModel.getDocuments()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DocumentStatusTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DocumentStatusTest.java deleted file mode 100644 index a1009008c6b..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/DocumentStatusTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the DocumentStatus model. */ -public class DocumentStatusTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testDocumentStatus() throws Throwable { - DocumentStatus documentStatusModel = new DocumentStatus(); - assertNull(documentStatusModel.getDocumentId()); - assertNull(documentStatusModel.getFilename()); - assertNull(documentStatusModel.getStatus()); - assertNull(documentStatusModel.getModelId()); - assertNull(documentStatusModel.getBaseModelId()); - assertNull(documentStatusModel.getSource()); - assertNull(documentStatusModel.getDetectedLanguageConfidence()); - assertNull(documentStatusModel.getTarget()); - assertNull(documentStatusModel.getCreated()); - assertNull(documentStatusModel.getCompleted()); - assertNull(documentStatusModel.getWordCount()); - assertNull(documentStatusModel.getCharacterCount()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetDocumentStatusOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetDocumentStatusOptionsTest.java deleted file mode 100644 index 00dfee6957c..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetDocumentStatusOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetDocumentStatusOptions model. */ -public class GetDocumentStatusOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetDocumentStatusOptions() throws Throwable { - GetDocumentStatusOptions getDocumentStatusOptionsModel = - new GetDocumentStatusOptions.Builder().documentId("testString").build(); - assertEquals(getDocumentStatusOptionsModel.documentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetDocumentStatusOptionsError() throws Throwable { - new GetDocumentStatusOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetModelOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetModelOptionsTest.java deleted file mode 100644 index ed26f06d892..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/GetModelOptionsTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the GetModelOptions model. */ -public class GetModelOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testGetModelOptions() throws Throwable { - GetModelOptions getModelOptionsModel = - new GetModelOptions.Builder().modelId("testString").build(); - assertEquals(getModelOptionsModel.modelId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testGetModelOptionsError() throws Throwable { - new GetModelOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguageTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguageTest.java deleted file mode 100644 index 38d6afa381f..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguageTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the IdentifiableLanguage model. */ -public class IdentifiableLanguageTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testIdentifiableLanguage() throws Throwable { - IdentifiableLanguage identifiableLanguageModel = new IdentifiableLanguage(); - assertNull(identifiableLanguageModel.getLanguage()); - assertNull(identifiableLanguageModel.getName()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguagesTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguagesTest.java deleted file mode 100644 index 574ccb6888d..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiableLanguagesTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the IdentifiableLanguages model. */ -public class IdentifiableLanguagesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testIdentifiableLanguages() throws Throwable { - IdentifiableLanguages identifiableLanguagesModel = new IdentifiableLanguages(); - assertNull(identifiableLanguagesModel.getLanguages()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguageTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguageTest.java deleted file mode 100644 index a4d02b0c732..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguageTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the IdentifiedLanguage model. */ -public class IdentifiedLanguageTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testIdentifiedLanguage() throws Throwable { - IdentifiedLanguage identifiedLanguageModel = new IdentifiedLanguage(); - assertNull(identifiedLanguageModel.getLanguage()); - assertNull(identifiedLanguageModel.getConfidence()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguagesTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguagesTest.java deleted file mode 100644 index 132aec42388..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifiedLanguagesTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the IdentifiedLanguages model. */ -public class IdentifiedLanguagesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testIdentifiedLanguages() throws Throwable { - IdentifiedLanguages identifiedLanguagesModel = new IdentifiedLanguages(); - assertNull(identifiedLanguagesModel.getLanguages()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifyOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifyOptionsTest.java deleted file mode 100644 index f85f5707dd1..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/IdentifyOptionsTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the IdentifyOptions model. */ -public class IdentifyOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testIdentifyOptions() throws Throwable { - IdentifyOptions identifyOptionsModel = new IdentifyOptions.Builder().text("testString").build(); - assertEquals(identifyOptionsModel.text(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testIdentifyOptionsError() throws Throwable { - new IdentifyOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/LanguageTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/LanguageTest.java deleted file mode 100644 index 12ee1374a5d..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/LanguageTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Language model. */ -public class LanguageTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testLanguage() throws Throwable { - Language languageModel = new Language(); - assertNull(languageModel.getLanguage()); - assertNull(languageModel.getLanguageName()); - assertNull(languageModel.getNativeLanguageName()); - assertNull(languageModel.getCountryCode()); - assertNull(languageModel.isWordsSeparated()); - assertNull(languageModel.getDirection()); - assertNull(languageModel.isSupportedAsSource()); - assertNull(languageModel.isSupportedAsTarget()); - assertNull(languageModel.isIdentifiable()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/LanguagesTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/LanguagesTest.java deleted file mode 100644 index 9b7b92c13fd..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/LanguagesTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Languages model. */ -public class LanguagesTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testLanguages() throws Throwable { - Languages languagesModel = new Languages(); - assertNull(languagesModel.getLanguages()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListDocumentsOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListDocumentsOptionsTest.java deleted file mode 100644 index 70b62c22cb7..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListDocumentsOptionsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListDocumentsOptions model. */ -public class ListDocumentsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListDocumentsOptions() throws Throwable { - ListDocumentsOptions listDocumentsOptionsModel = new ListDocumentsOptions(); - assertNotNull(listDocumentsOptionsModel); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListIdentifiableLanguagesOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListIdentifiableLanguagesOptionsTest.java deleted file mode 100644 index e8c6a929850..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListIdentifiableLanguagesOptionsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListIdentifiableLanguagesOptions model. */ -public class ListIdentifiableLanguagesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListIdentifiableLanguagesOptions() throws Throwable { - ListIdentifiableLanguagesOptions listIdentifiableLanguagesOptionsModel = - new ListIdentifiableLanguagesOptions(); - assertNotNull(listIdentifiableLanguagesOptionsModel); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListLanguagesOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListLanguagesOptionsTest.java deleted file mode 100644 index 9f984801866..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListLanguagesOptionsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListLanguagesOptions model. */ -public class ListLanguagesOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListLanguagesOptions() throws Throwable { - ListLanguagesOptions listLanguagesOptionsModel = new ListLanguagesOptions(); - assertNotNull(listLanguagesOptionsModel); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListModelsOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListModelsOptionsTest.java deleted file mode 100644 index df432681d29..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/ListModelsOptionsTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the ListModelsOptions model. */ -public class ListModelsOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testListModelsOptions() throws Throwable { - ListModelsOptions listModelsOptionsModel = - new ListModelsOptions.Builder() - .source("testString") - .target("testString") - .xDefault(true) - .build(); - assertEquals(listModelsOptionsModel.source(), "testString"); - assertEquals(listModelsOptionsModel.target(), "testString"); - assertEquals(listModelsOptionsModel.xDefault(), Boolean.valueOf(true)); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslateDocumentOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslateDocumentOptionsTest.java deleted file mode 100644 index cbc19722ab8..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslateDocumentOptionsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.apache.commons.io.IOUtils; -import org.testng.annotations.Test; - -/** Unit test class for the TranslateDocumentOptions model. */ -public class TranslateDocumentOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTranslateDocumentOptions() throws Throwable { - TranslateDocumentOptions translateDocumentOptionsModel = - new TranslateDocumentOptions.Builder() - .file(TestUtilities.createMockStream("This is a mock file.")) - .filename("testString") - .fileContentType("application/mspowerpoint") - .modelId("testString") - .source("testString") - .target("testString") - .documentId("testString") - .build(); - assertEquals( - IOUtils.toString(translateDocumentOptionsModel.file()), - IOUtils.toString(TestUtilities.createMockStream("This is a mock file."))); - assertEquals(translateDocumentOptionsModel.filename(), "testString"); - assertEquals(translateDocumentOptionsModel.fileContentType(), "application/mspowerpoint"); - assertEquals(translateDocumentOptionsModel.modelId(), "testString"); - assertEquals(translateDocumentOptionsModel.source(), "testString"); - assertEquals(translateDocumentOptionsModel.target(), "testString"); - assertEquals(translateDocumentOptionsModel.documentId(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTranslateDocumentOptionsError() throws Throwable { - new TranslateDocumentOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslateOptionsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslateOptionsTest.java deleted file mode 100644 index 12945997f6f..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslateOptionsTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020, 2022. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TranslateOptions model. */ -public class TranslateOptionsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTranslateOptions() throws Throwable { - TranslateOptions translateOptionsModel = - new TranslateOptions.Builder() - .text(java.util.Arrays.asList("testString")) - .modelId("testString") - .source("testString") - .target("testString") - .build(); - assertEquals(translateOptionsModel.text(), java.util.Arrays.asList("testString")); - assertEquals(translateOptionsModel.modelId(), "testString"); - assertEquals(translateOptionsModel.source(), "testString"); - assertEquals(translateOptionsModel.target(), "testString"); - } - - @Test(expectedExceptions = IllegalArgumentException.class) - public void testTranslateOptionsError() throws Throwable { - new TranslateOptions.Builder().build(); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationModelTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationModelTest.java deleted file mode 100644 index 522411ac5b2..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationModelTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TranslationModel model. */ -public class TranslationModelTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTranslationModel() throws Throwable { - TranslationModel translationModelModel = new TranslationModel(); - assertNull(translationModelModel.getModelId()); - assertNull(translationModelModel.getName()); - assertNull(translationModelModel.getSource()); - assertNull(translationModelModel.getTarget()); - assertNull(translationModelModel.getBaseModelId()); - assertNull(translationModelModel.getDomain()); - assertNull(translationModelModel.isCustomizable()); - assertNull(translationModelModel.isDefaultModel()); - assertNull(translationModelModel.getOwner()); - assertNull(translationModelModel.getStatus()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationModelsTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationModelsTest.java deleted file mode 100644 index 6f45a8af8ca..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationModelsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TranslationModels model. */ -public class TranslationModelsTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTranslationModels() throws Throwable { - TranslationModels translationModelsModel = new TranslationModels(); - assertNull(translationModelsModel.getModels()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationResultTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationResultTest.java deleted file mode 100644 index 0637ea00c4c..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationResultTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the TranslationResult model. */ -public class TranslationResultTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTranslationResult() throws Throwable { - TranslationResult translationResultModel = new TranslationResult(); - assertNull(translationResultModel.getWordCount()); - assertNull(translationResultModel.getCharacterCount()); - assertNull(translationResultModel.getDetectedLanguage()); - assertNull(translationResultModel.getDetectedLanguageConfidence()); - assertNull(translationResultModel.getTranslations()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationTest.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationTest.java deleted file mode 100644 index 026918e149c..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/model/TranslationTest.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ - -package com.ibm.watson.language_translator.v3.model; - -import static org.testng.Assert.*; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.watson.language_translator.v3.utils.TestUtilities; -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import org.testng.annotations.Test; - -/** Unit test class for the Translation model. */ -public class TranslationTest { - final HashMap mockStreamMap = TestUtilities.createMockStreamMap(); - final List mockListFileWithMetadata = - TestUtilities.creatMockListFileWithMetadata(); - - @Test - public void testTranslation() throws Throwable { - Translation translationModel = new Translation(); - assertNull(translationModel.getTranslation()); - } -} diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/testng.xml b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/testng.xml deleted file mode 100644 index 15cdc628b3b..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/testng.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/utils/TestUtilities.java b/language-translator/src/test/java/com/ibm/watson/language_translator/v3/utils/TestUtilities.java deleted file mode 100644 index 0516d727da0..00000000000 --- a/language-translator/src/test/java/com/ibm/watson/language_translator/v3/utils/TestUtilities.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * (C) Copyright IBM Corp. 2020. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -package com.ibm.watson.language_translator.v3.utils; - -import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; -import com.ibm.cloud.sdk.core.util.DateUtils; -import com.ibm.cloud.sdk.core.util.GsonSingleton; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import okhttp3.HttpUrl; -import okhttp3.mockwebserver.RecordedRequest; - -/** A class used by the unit tests containing utility functions. */ -public class TestUtilities { - public static Map createMockMap() { - Map mockMap = new HashMap<>(); - mockMap.put("foo", "bar"); - return mockMap; - } - - public static HashMap createMockStreamMap() { - return new HashMap() { - { - put("key1", createMockStream("This is a mock file.")); - } - }; - } - - public static Map parseQueryString(RecordedRequest req) { - Map queryMap = new HashMap<>(); - - try { - HttpUrl requestUrl = req.getRequestUrl(); - - if (requestUrl != null) { - Set queryParamsNames = requestUrl.queryParameterNames(); - // map the parameter name to its corresponding value - for (String p : queryParamsNames) { - // get the corresponding value for the parameter (p) - List val = requestUrl.queryParameterValues(p); - if (val != null && !val.isEmpty()) { - String joinedQuery = String.join(",", val); - queryMap.put(p, joinedQuery); - } - } - } - if (queryMap.isEmpty()) { - return null; - } - } catch (Exception e) { - return null; - } - - return queryMap; - } - - public static String parseReqPath(RecordedRequest req) { - String parsedPath = null; - - try { - String fullPath = req.getPath(); - if (fullPath != null && !fullPath.isEmpty()) { - // retrieve the path segment before the query parameter - parsedPath = fullPath.split("\\?", 2)[0]; - } - if (parsedPath.isEmpty() || parsedPath == null) { - return null; - } - - } catch (Exception e) { - return null; - } - - return parsedPath; - } - - public static String serialize(Object obj) { - return GsonSingleton.getGson().toJson(obj); - } - - public static T deserialize(String json, Class clazz) { - return GsonSingleton.getGson().fromJson(json, clazz); - } - - public static InputStream createMockStream(String s) { - return new ByteArrayInputStream(s.getBytes()); - } - - public static List creatMockListFileWithMetadata() { - List list = new ArrayList(); - byte[] fileBytes = {(byte) 0xde, (byte) 0xad, (byte) 0xbe, (byte) 0xef}; - InputStream inputStream = new ByteArrayInputStream(fileBytes); - FileWithMetadata.Builder builder = new FileWithMetadata.Builder(); - builder.data(inputStream); - FileWithMetadata fileWithMetadata = builder.build(); - list.add(fileWithMetadata); - - return list; - } - - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); - } - - public static Date createMockDate(String date) throws Exception { - return DateUtils.parseAsDate(date); - } - - public static Date createMockDateTime(String date) throws Exception { - return DateUtils.parseAsDateTime(date); - } -} diff --git a/language-translator/src/test/resources/language_translation/document_status.json b/language-translator/src/test/resources/language_translation/document_status.json deleted file mode 100644 index 56536bcee0c..00000000000 --- a/language-translator/src/test/resources/language_translation/document_status.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "document_id": "1bdb9528-bf73-45eb-87fa-c4f519af23a0", - "filename": "en.pdf", - "model_id": "12345", - "base_model_id": "en-fr", - "source": "en", - "target": "fr", - "status": "available", - "created": "2018-08-24T08:20:30.5Z", - "completed": "2018-08-24T08:20:35.5Z", - "word_count": 12, - "character_count": 100 -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/document_to_translate.txt b/language-translator/src/test/resources/language_translation/document_to_translate.txt deleted file mode 100644 index 432334030a9..00000000000 --- a/language-translator/src/test/resources/language_translation/document_to_translate.txt +++ /dev/null @@ -1,2 +0,0 @@ -Where is the library? -How are you? \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/glossary.tmx b/language-translator/src/test/resources/language_translation/glossary.tmx deleted file mode 100644 index 427dfbda475..00000000000 --- a/language-translator/src/test/resources/language_translation/glossary.tmx +++ /dev/null @@ -1,28 +0,0 @@ - - -

- - - - admittedTerm-admn-sts - entryTerm - Colloquial use term - Informal salutation - Hello - - - admittedTerm-admn-sts - entryTerm - Termino de uso coloquial - Saludo informal - Hola - - - - \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/identifiable_languages.json b/language-translator/src/test/resources/language_translation/identifiable_languages.json deleted file mode 100644 index f5e31f4fde5..00000000000 --- a/language-translator/src/test/resources/language_translation/identifiable_languages.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "languages": [ - { - "language": "af", - "name": "Afrikaans" - }, - { - "language": "ar", - "name": "Arabic" - }, - { - "language": "az", - "name": "Azerbaijani" - }, - { - "language": "ba", - "name": "Bashkir" - }, - { - "language": "be", - "name": "Belarusian" - }, - { - "language": "bg", - "name": "Bulgarian" - }, - { - "language": "bn", - "name": "Bengali" - }, - { - "language": "bs", - "name": "Bosnian" - }, - { - "language": "cs", - "name": "Czech" - }, - { - "language": "cv", - "name": "Chuvash" - }, - { - "language": "da", - "name": "Danish" - }, - { - "language": "de", - "name": "German" - }, - { - "language": "el", - "name": "Greek" - }, - { - "language": "en", - "name": "English" - }, - { - "language": "eo", - "name": "Esperanto" - }, - { - "language": "es", - "name": "Spanish" - }, - { - "language": "et", - "name": "Estonian" - }, - { - "language": "eu", - "name": "Basque" - }, - { - "language": "fa", - "name": "Persian" - }, - { - "language": "fi", - "name": "Finnish" - }, - { - "language": "fr", - "name": "French" - }, - { - "language": "gu", - "name": "Gujarati" - }, - { - "language": "he", - "name": "Hebrew" - }, - { - "language": "hi", - "name": "Hindi" - }, - { - "language": "ht", - "name": "Haitian" - }, - { - "language": "hu", - "name": "Hungarian" - }, - { - "language": "hy", - "name": "Armenian" - }, - { - "language": "id", - "name": "Indonesian" - }, - { - "language": "is", - "name": "Icelandic" - }, - { - "language": "it", - "name": "Italian" - }, - { - "language": "ja", - "name": "Japanese" - }, - { - "language": "ka", - "name": "Georgian" - }, - { - "language": "kk", - "name": "Kazakh" - }, - { - "language": "km", - "name": "Central Khmer" - }, - { - "language": "ko", - "name": "Korean" - }, - { - "language": "ku", - "name": "Kurdish" - }, - { - "language": "ky", - "name": "Kirghiz" - }, - { - "language": "lt", - "name": "Lithuanian" - }, - { - "language": "lv", - "name": "Latvian" - }, - { - "language": "ml", - "name": "Malayalam" - }, - { - "language": "mn", - "name": "Mongolian" - }, - { - "language": "nb", - "name": "Norwegian Bokmal" - }, - { - "language": "nl", - "name": "Dutch" - }, - { - "language": "nn", - "name": "Norwegian Nynorsk" - }, - { - "language": "pa", - "name": "Panjabi" - }, - { - "language": "pl", - "name": "Polish" - }, - { - "language": "ps", - "name": "Pushto" - }, - { - "language": "pt", - "name": "Portuguese" - }, - { - "language": "ro", - "name": "Romanian" - }, - { - "language": "ru", - "name": "Russian" - }, - { - "language": "sk", - "name": "Slovakian" - }, - { - "language": "so", - "name": "Somali" - }, - { - "language": "sq", - "name": "Albanian" - }, - { - "language": "sv", - "name": "Swedish" - }, - { - "language": "ta", - "name": "Tamil" - }, - { - "language": "te", - "name": "Telugu" - }, - { - "language": "tr", - "name": "Turkish" - }, - { - "language": "uk", - "name": "Ukrainian" - }, - { - "language": "ur", - "name": "Urdu" - }, - { - "language": "vi", - "name": "Vietnamese" - }, - { - "language": "zh", - "name": "Chinese" - }, - { - "language": "zh-TW", - "name": "Traditional Chinese" - } - ] -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/identify_response.json b/language-translator/src/test/resources/language_translation/identify_response.json deleted file mode 100644 index d1544ca6490..00000000000 --- a/language-translator/src/test/resources/language_translation/identify_response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "languages": [ - { - "language": "en", - "confidence": 0.877159 - }, - { - "language": "af", - "confidence": 0.0752636 - } - ] -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/list_documents_response.json b/language-translator/src/test/resources/language_translation/list_documents_response.json deleted file mode 100644 index d6481d014fe..00000000000 --- a/language-translator/src/test/resources/language_translation/list_documents_response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "documents": [ - { - "document_id": "1bdb9528-bf73-45eb-87fa-c4f519af23a0", - "filename": "en.docx", - "model_id": "9ef1eda2-e4dc-460f-b51a-efeec95f239f", - "base_model_id": "en-de", - "source": "en", - "target": "de", - "status": "processing", - "created": "2018-08-24T08:20:30.5Z", - "completed": "2018-08-24T08:20:35.5Z", - "word_count": 12, - "character_count": 100 - }, - { - "document_id": "1bdb9528-bf73-45eb-87fa-c4f519af23a0", - "filename": "en.pdf", - "model_id": "9ef1eda2-e4dc-460f-b51a-efeec95f239f", - "base_model_id": "en-fr", - "source": "en", - "target": "fr", - "status": "available", - "created": "2018-08-24T08:20:30.5Z", - "completed": "2018-08-24T08:20:35.5Z" - } - ] -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/model.json b/language-translator/src/test/resources/language_translation/model.json deleted file mode 100644 index 92a200c011c..00000000000 --- a/language-translator/src/test/resources/language_translation/model.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "model_id": "ar-en", - "source": "ar", - "target": "en", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/models.json b/language-translator/src/test/resources/language_translation/models.json deleted file mode 100644 index 3cfccfabe49..00000000000 --- a/language-translator/src/test/resources/language_translation/models.json +++ /dev/null @@ -1,290 +0,0 @@ -{ - "models": [ - { - "model_id": "ar-en", - "source": "ar", - "target": "en", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "ar-en-conversational", - "source": "ar", - "target": "en", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "arz-en", - "source": "arz", - "target": "en", - "base_model_id": "", - "domain": "news", - "customizable": false, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-ar", - "source": "en", - "target": "ar", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-ar-conversational", - "source": "en", - "target": "ar", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-arz", - "source": "en", - "target": "arz", - "base_model_id": "", - "domain": "news", - "customizable": false, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-es", - "source": "en", - "target": "es", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-es-conversational", - "source": "en", - "target": "es", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-fr", - "source": "en", - "target": "fr", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-fr-conversational", - "source": "en", - "target": "fr", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-pt", - "source": "en", - "target": "pt", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "en-pt-conversational", - "source": "en", - "target": "pt", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "es-en", - "source": "es", - "target": "en", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "es-en-conversational", - "source": "es", - "target": "en", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "es-en-patent", - "source": "es", - "target": "en", - "base_model_id": "", - "domain": "patent", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "fr-en", - "source": "fr", - "target": "en", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "fr-en-conversational", - "source": "fr", - "target": "en", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "ko-en-patent", - "source": "ko", - "target": "en", - "base_model_id": "", - "domain": "patent", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "pt-en", - "source": "pt", - "target": "en", - "base_model_id": "", - "domain": "news", - "customizable": true, - "default_model": true, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "pt-en-conversational", - "source": "pt", - "target": "en", - "base_model_id": "", - "domain": "conversational", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "pt-en-patent", - "source": "pt", - "target": "en", - "base_model_id": "", - "domain": "patent", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - }, - { - "model_id": "zh-en-patent", - "source": "zh", - "target": "en", - "base_model_id": "", - "domain": "patent", - "customizable": false, - "default_model": false, - "owner": "", - "status": "available", - "name": "", - "train_log": null - } - ] -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/multiple_translations.json b/language-translator/src/test/resources/language_translation/multiple_translations.json deleted file mode 100644 index 1e4eb6f4744..00000000000 --- a/language-translator/src/test/resources/language_translation/multiple_translations.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "translations": [ - { - "translation": "El equipo es increíble IBM Watson" - }, - { - "translation": "Bienvenido a la era cognitiva" - } - ], - "word_count": 6, - "character_count": 20 -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/single_translation.json b/language-translator/src/test/resources/language_translation/single_translation.json deleted file mode 100644 index 22a4d0488a0..00000000000 --- a/language-translator/src/test/resources/language_translation/single_translation.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "translations": [ - { - "translation": "El equipo es increíble IBM Watson" - } - ], - "word_count": 6, - "character_count": 20 -} \ No newline at end of file diff --git a/language-translator/src/test/resources/language_translation/translated_document.txt b/language-translator/src/test/resources/language_translation/translated_document.txt deleted file mode 100644 index b15c31adfea..00000000000 --- a/language-translator/src/test/resources/language_translation/translated_document.txt +++ /dev/null @@ -1,2 +0,0 @@ -¿Dónde está la biblioteca? -¿Cómo estás? \ No newline at end of file diff --git a/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java b/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java index 49b64505d07..7db48403f4d 100644 --- a/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java +++ b/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstanding.java @@ -63,16 +63,6 @@ * with Watson Knowledge Studio to detect custom entities and relations in Natural Language * Understanding. * - *

IBM is sunsetting Watson Natural Language Understanding Custom Sentiment (BETA). From **June - * 3, 2023** onward, you will no longer be able to use the Custom Sentiment feature.<br - * /><br />To ensure we continue providing our clients with robust and powerful text - * classification capabilities, IBM recently announced the general availability of a new - * [single-label text classification - * capability](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-classifications). - * This new feature includes extended language support and training data customizations suited for - * building a custom sentiment classifier.<br /><br />If you would like more information - * or further guidance, please contact IBM Cloud Support.{: deprecated}. - * *

API Version: 1.0 See: https://cloud.ibm.com/docs/natural-language-understanding */ public class NaturalLanguageUnderstanding extends BaseService { @@ -168,7 +158,7 @@ public void setVersion(final String version) { * *

Analyzes text, HTML, or a public webpage for the following features: - Categories - * Classifications - Concepts - Emotion - Entities - Keywords - Metadata - Relations - Semantic - * roles - Sentiment - Syntax - Summarization (Experimental) + * roles - Sentiment - Syntax * *

If a language for the input text is not specified with the `language` parameter, the service * [automatically detects the diff --git a/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/Features.java b/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/Features.java index 6a86431b841..203f312f5d9 100644 --- a/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/Features.java +++ b/natural-language-understanding/src/main/java/com/ibm/watson/natural_language_understanding/v1/model/Features.java @@ -31,7 +31,6 @@ public class Features extends GenericModel { protected SemanticRolesOptions semanticRoles; protected SentimentOptions sentiment; - protected SummarizationOptions summarization; protected CategoriesOptions categories; protected SyntaxOptions syntax; @@ -46,7 +45,6 @@ public static class Builder { private RelationsOptions relations; private SemanticRolesOptions semanticRoles; private SentimentOptions sentiment; - private SummarizationOptions summarization; private CategoriesOptions categories; private SyntaxOptions syntax; @@ -65,7 +63,6 @@ private Builder(Features features) { this.relations = features.relations; this.semanticRoles = features.semanticRoles; this.sentiment = features.sentiment; - this.summarization = features.summarization; this.categories = features.categories; this.syntax = features.syntax; } @@ -181,17 +178,6 @@ public Builder sentiment(SentimentOptions sentiment) { return this; } - /** - * Set the summarization. - * - * @param summarization the summarization - * @return the Features builder - */ - public Builder summarization(SummarizationOptions summarization) { - this.summarization = summarization; - return this; - } - /** * Set the categories. * @@ -227,7 +213,6 @@ protected Features(Builder builder) { relations = builder.relations; semanticRoles = builder.semanticRoles; sentiment = builder.sentiment; - summarization = builder.summarization; categories = builder.categories; syntax = builder.syntax; } @@ -371,21 +356,6 @@ public SentimentOptions sentiment() { return sentiment; } - /** - * Gets the summarization. - * - *

(Experimental) Returns a summary of content. - * - *

Supported languages: English only. - * - *

Supported regions: Dallas region only. - * - * @return the summarization - */ - public SummarizationOptions summarization() { - return summarization; - } - /** * Gets the categories. * diff --git a/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstandingTest.java b/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstandingTest.java index 1e007bef4c5..36e1f0ace91 100644 --- a/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstandingTest.java +++ b/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/NaturalLanguageUnderstandingTest.java @@ -47,7 +47,6 @@ import com.ibm.watson.natural_language_understanding.v1.model.RelationsOptions; import com.ibm.watson.natural_language_understanding.v1.model.SemanticRolesOptions; import com.ibm.watson.natural_language_understanding.v1.model.SentimentOptions; -import com.ibm.watson.natural_language_understanding.v1.model.SummarizationOptions; import com.ibm.watson.natural_language_understanding.v1.model.SyntaxOptions; import com.ibm.watson.natural_language_understanding.v1.model.SyntaxOptionsTokens; import com.ibm.watson.natural_language_understanding.v1.model.UpdateCategoriesModelOptions; @@ -155,10 +154,6 @@ public void testAnalyzeWOptions() throws Throwable { .targets(java.util.Arrays.asList("testString")) .build(); - // Construct an instance of the SummarizationOptions model - SummarizationOptions summarizationOptionsModel = - new SummarizationOptions.Builder().limit(Long.valueOf("3")).build(); - // Construct an instance of the CategoriesOptions model CategoriesOptions categoriesOptionsModel = new CategoriesOptions.Builder() @@ -187,7 +182,6 @@ public void testAnalyzeWOptions() throws Throwable { .relations(relationsOptionsModel) .semanticRoles(semanticRolesOptionsModel) .sentiment(sentimentOptionsModel) - .summarization(summarizationOptionsModel) .categories(categoriesOptionsModel) .syntax(syntaxOptionsModel) .build(); diff --git a/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/AnalyzeOptionsTest.java b/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/AnalyzeOptionsTest.java index 40155064f1e..3708c87292f 100644 --- a/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/AnalyzeOptionsTest.java +++ b/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/AnalyzeOptionsTest.java @@ -92,10 +92,6 @@ public void testAnalyzeOptions() throws Throwable { assertEquals(sentimentOptionsModel.document(), Boolean.valueOf(true)); assertEquals(sentimentOptionsModel.targets(), java.util.Arrays.asList("testString")); - SummarizationOptions summarizationOptionsModel = - new SummarizationOptions.Builder().limit(Long.valueOf("3")).build(); - assertEquals(summarizationOptionsModel.limit(), Long.valueOf("3")); - CategoriesOptions categoriesOptionsModel = new CategoriesOptions.Builder() .explanation(false) @@ -127,7 +123,6 @@ public void testAnalyzeOptions() throws Throwable { .relations(relationsOptionsModel) .semanticRoles(semanticRolesOptionsModel) .sentiment(sentimentOptionsModel) - .summarization(summarizationOptionsModel) .categories(categoriesOptionsModel) .syntax(syntaxOptionsModel) .build(); @@ -141,7 +136,6 @@ public void testAnalyzeOptions() throws Throwable { assertEquals(featuresModel.relations(), relationsOptionsModel); assertEquals(featuresModel.semanticRoles(), semanticRolesOptionsModel); assertEquals(featuresModel.sentiment(), sentimentOptionsModel); - assertEquals(featuresModel.summarization(), summarizationOptionsModel); assertEquals(featuresModel.categories(), categoriesOptionsModel); assertEquals(featuresModel.syntax(), syntaxOptionsModel); diff --git a/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/FeaturesTest.java b/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/FeaturesTest.java index d31b3ea8d30..5b94606e018 100644 --- a/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/FeaturesTest.java +++ b/natural-language-understanding/src/test/java/com/ibm/watson/natural_language_understanding/v1/model/FeaturesTest.java @@ -92,10 +92,6 @@ public void testFeatures() throws Throwable { assertEquals(sentimentOptionsModel.document(), Boolean.valueOf(true)); assertEquals(sentimentOptionsModel.targets(), java.util.Arrays.asList("testString")); - SummarizationOptions summarizationOptionsModel = - new SummarizationOptions.Builder().limit(Long.valueOf("3")).build(); - assertEquals(summarizationOptionsModel.limit(), Long.valueOf("3")); - CategoriesOptions categoriesOptionsModel = new CategoriesOptions.Builder() .explanation(false) @@ -127,7 +123,6 @@ public void testFeatures() throws Throwable { .relations(relationsOptionsModel) .semanticRoles(semanticRolesOptionsModel) .sentiment(sentimentOptionsModel) - .summarization(summarizationOptionsModel) .categories(categoriesOptionsModel) .syntax(syntaxOptionsModel) .build(); @@ -141,7 +136,6 @@ public void testFeatures() throws Throwable { assertEquals(featuresModel.relations(), relationsOptionsModel); assertEquals(featuresModel.semanticRoles(), semanticRolesOptionsModel); assertEquals(featuresModel.sentiment(), sentimentOptionsModel); - assertEquals(featuresModel.summarization(), summarizationOptionsModel); assertEquals(featuresModel.categories(), categoriesOptionsModel); assertEquals(featuresModel.syntax(), syntaxOptionsModel); @@ -161,7 +155,6 @@ public void testFeatures() throws Throwable { assertEquals(featuresModelNew.relations().toString(), relationsOptionsModel.toString()); assertEquals(featuresModelNew.semanticRoles().toString(), semanticRolesOptionsModel.toString()); assertEquals(featuresModelNew.sentiment().toString(), sentimentOptionsModel.toString()); - assertEquals(featuresModelNew.summarization().toString(), summarizationOptionsModel.toString()); assertEquals(featuresModelNew.categories().toString(), categoriesOptionsModel.toString()); assertEquals(featuresModelNew.syntax().toString(), syntaxOptionsModel.toString()); } diff --git a/pom.xml b/pom.xml index c70d8b0c9ad..409f2488d09 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,6 @@ /assistant /discovery - /language-translator /natural-language-understanding /speech-to-text /text-to-speech @@ -139,6 +138,11 @@ okhttp ${okhttp3-version} + + com.launchdarkly + okhttp-eventsource + 4.1.1 + com.squareup.okhttp3 mockwebserver diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java index 433fbcd6954..e4b316cbc95 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/SpeechToText.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 + * IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 */ package com.ibm.watson.speech_to_text.v1; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModel.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModel.java index 8e188067d15..3c4cf150b89 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModel.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModels.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModels.java index bc6f448af67..81dfdf516de 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModels.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AcousticModels.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddAudioOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddAudioOptions.java index f3165a888aa..3fdded026ec 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddAudioOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddAudioOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddCorpusOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddCorpusOptions.java index b25865a120d..d302ff9f437 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddCorpusOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddCorpusOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddGrammarOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddGrammarOptions.java index 9f6e9247135..624b969f57d 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddGrammarOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddGrammarOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordOptions.java index 35baf8e95cd..5a0f1767848 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordsOptions.java index edf9356d12f..b8ed50e4b53 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AddWordsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioDetails.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioDetails.java index 6c3f673fbfa..b51fe9da578 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioDetails.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioDetails.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioListing.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioListing.java index 67fcf8e028e..0cbaf3a2f23 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioListing.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioListing.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetrics.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetrics.java index f1d5778ffbb..8d5215cce88 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetrics.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetrics.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsDetails.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsDetails.java index b5e6fa7a9e4..da9a1d6e18c 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsDetails.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsDetails.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsHistogramBin.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsHistogramBin.java index 827b6e506ae..9c277eeca70 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsHistogramBin.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioMetricsHistogramBin.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResource.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResource.java index 35742fb0ee7..cd578042150 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResource.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResource.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResources.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResources.java index 342d21d2ee2..f9f2cf10233 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResources.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/AudioResources.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobOptions.java index 444d25e1128..f8f6e57fb33 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobsOptions.java index c7543de8689..6fb9c6211bb 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CheckJobsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpora.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpora.java index a009d40343f..2e6d64cd4d0 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpora.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpora.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpus.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpus.java index 4f691fb23df..6dba06236a1 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpus.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Corpus.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateAcousticModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateAcousticModelOptions.java index 501fdf6d255..c2105ed97d8 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateAcousticModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateAcousticModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -46,26 +47,38 @@ public interface BaseModelName { String EN_US_NARROWBANDMODEL = "en-US_NarrowbandModel"; /** en-US_ShortForm_NarrowbandModel. */ String EN_US_SHORTFORM_NARROWBANDMODEL = "en-US_ShortForm_NarrowbandModel"; + /** es-AR. */ + String ES_AR = "es-AR"; /** es-AR_BroadbandModel. */ String ES_AR_BROADBANDMODEL = "es-AR_BroadbandModel"; /** es-AR_NarrowbandModel. */ String ES_AR_NARROWBANDMODEL = "es-AR_NarrowbandModel"; + /** es-CL. */ + String ES_CL = "es-CL"; /** es-CL_BroadbandModel. */ String ES_CL_BROADBANDMODEL = "es-CL_BroadbandModel"; /** es-CL_NarrowbandModel. */ String ES_CL_NARROWBANDMODEL = "es-CL_NarrowbandModel"; + /** es-CO. */ + String ES_CO = "es-CO"; /** es-CO_BroadbandModel. */ String ES_CO_BROADBANDMODEL = "es-CO_BroadbandModel"; /** es-CO_NarrowbandModel. */ String ES_CO_NARROWBANDMODEL = "es-CO_NarrowbandModel"; + /** es-ES. */ + String ES_ES = "es-ES"; /** es-ES_BroadbandModel. */ String ES_ES_BROADBANDMODEL = "es-ES_BroadbandModel"; /** es-ES_NarrowbandModel. */ String ES_ES_NARROWBANDMODEL = "es-ES_NarrowbandModel"; + /** es-MX. */ + String ES_MX = "es-MX"; /** es-MX_BroadbandModel. */ String ES_MX_BROADBANDMODEL = "es-MX_BroadbandModel"; /** es-MX_NarrowbandModel. */ String ES_MX_NARROWBANDMODEL = "es-MX_NarrowbandModel"; + /** es-PE. */ + String ES_PE = "es-PE"; /** es-PE_BroadbandModel. */ String ES_PE_BROADBANDMODEL = "es-PE_BroadbandModel"; /** es-PE_NarrowbandModel. */ @@ -94,6 +107,8 @@ public interface BaseModelName { String NL_NL_BROADBANDMODEL = "nl-NL_BroadbandModel"; /** nl-NL_NarrowbandModel. */ String NL_NL_NARROWBANDMODEL = "nl-NL_NarrowbandModel"; + /** pt-BR. */ + String PT_BR = "pt-BR"; /** pt-BR_BroadbandModel. */ String PT_BR_BROADBANDMODEL = "pt-BR_BroadbandModel"; /** pt-BR_NarrowbandModel. */ diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateJobOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateJobOptions.java index 17661b801d3..bafdfe5340f 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateJobOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateJobOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -89,18 +90,26 @@ public interface Model { String EN_US_TELEPHONY = "en-US_Telephony"; /** en-WW_Medical_Telephony. */ String EN_WW_MEDICAL_TELEPHONY = "en-WW_Medical_Telephony"; + /** es-AR. */ + String ES_AR = "es-AR"; /** es-AR_BroadbandModel. */ String ES_AR_BROADBANDMODEL = "es-AR_BroadbandModel"; /** es-AR_NarrowbandModel. */ String ES_AR_NARROWBANDMODEL = "es-AR_NarrowbandModel"; + /** es-CL. */ + String ES_CL = "es-CL"; /** es-CL_BroadbandModel. */ String ES_CL_BROADBANDMODEL = "es-CL_BroadbandModel"; /** es-CL_NarrowbandModel. */ String ES_CL_NARROWBANDMODEL = "es-CL_NarrowbandModel"; + /** es-CO. */ + String ES_CO = "es-CO"; /** es-CO_BroadbandModel. */ String ES_CO_BROADBANDMODEL = "es-CO_BroadbandModel"; /** es-CO_NarrowbandModel. */ String ES_CO_NARROWBANDMODEL = "es-CO_NarrowbandModel"; + /** es-ES. */ + String ES_ES = "es-ES"; /** es-ES_BroadbandModel. */ String ES_ES_BROADBANDMODEL = "es-ES_BroadbandModel"; /** es-ES_NarrowbandModel. */ @@ -111,10 +120,14 @@ public interface Model { String ES_ES_TELEPHONY = "es-ES_Telephony"; /** es-LA_Telephony. */ String ES_LA_TELEPHONY = "es-LA_Telephony"; + /** es-MX. */ + String ES_MX = "es-MX"; /** es-MX_BroadbandModel. */ String ES_MX_BROADBANDMODEL = "es-MX_BroadbandModel"; /** es-MX_NarrowbandModel. */ String ES_MX_NARROWBANDMODEL = "es-MX_NarrowbandModel"; + /** es-PE. */ + String ES_PE = "es-PE"; /** es-PE_BroadbandModel. */ String ES_PE_BROADBANDMODEL = "es-PE_BroadbandModel"; /** es-PE_NarrowbandModel. */ @@ -177,6 +190,8 @@ public interface Model { String NL_NL_NARROWBANDMODEL = "nl-NL_NarrowbandModel"; /** nl-NL_Telephony. */ String NL_NL_TELEPHONY = "nl-NL_Telephony"; + /** pt-BR. */ + String PT_BR = "pt-BR"; /** pt-BR_BroadbandModel. */ String PT_BR_BROADBANDMODEL = "pt-BR_BroadbandModel"; /** pt-BR_Multimedia. */ diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateLanguageModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateLanguageModelOptions.java index 2538ef33663..91228c8cc68 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateLanguageModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CreateLanguageModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -77,18 +78,26 @@ public interface BaseModelName { String EN_US_TELEPHONY = "en-US_Telephony"; /** en-WW_Medical_Telephony. */ String EN_WW_MEDICAL_TELEPHONY = "en-WW_Medical_Telephony"; + /** es-AR. */ + String ES_AR = "es-AR"; /** es-AR_BroadbandModel. */ String ES_AR_BROADBANDMODEL = "es-AR_BroadbandModel"; /** es-AR_NarrowbandModel. */ String ES_AR_NARROWBANDMODEL = "es-AR_NarrowbandModel"; + /** es-CL. */ + String ES_CL = "es-CL"; /** es-CL_BroadbandModel. */ String ES_CL_BROADBANDMODEL = "es-CL_BroadbandModel"; /** es-CL_NarrowbandModel. */ String ES_CL_NARROWBANDMODEL = "es-CL_NarrowbandModel"; + /** es-CO. */ + String ES_CO = "es-CO"; /** es-CO_BroadbandModel. */ String ES_CO_BROADBANDMODEL = "es-CO_BroadbandModel"; /** es-CO_NarrowbandModel. */ String ES_CO_NARROWBANDMODEL = "es-CO_NarrowbandModel"; + /** es-ES. */ + String ES_ES = "es-ES"; /** es-ES_BroadbandModel. */ String ES_ES_BROADBANDMODEL = "es-ES_BroadbandModel"; /** es-ES_NarrowbandModel. */ @@ -99,10 +108,14 @@ public interface BaseModelName { String ES_ES_TELEPHONY = "es-ES_Telephony"; /** es-LA_Telephony. */ String ES_LA_TELEPHONY = "es-LA_Telephony"; + /** es-MX. */ + String ES_MX = "es-MX"; /** es-MX_BroadbandModel. */ String ES_MX_BROADBANDMODEL = "es-MX_BroadbandModel"; /** es-MX_NarrowbandModel. */ String ES_MX_NARROWBANDMODEL = "es-MX_NarrowbandModel"; + /** es-PE. */ + String ES_PE = "es-PE"; /** es-PE_BroadbandModel. */ String ES_PE_BROADBANDMODEL = "es-PE_BroadbandModel"; /** es-PE_NarrowbandModel. */ @@ -165,6 +178,8 @@ public interface BaseModelName { String NL_NL_NARROWBANDMODEL = "nl-NL_NarrowbandModel"; /** nl-NL_Telephony. */ String NL_NL_TELEPHONY = "nl-NL_Telephony"; + /** pt-BR. */ + String PT_BR = "pt-BR"; /** pt-BR_BroadbandModel. */ String PT_BR_BROADBANDMODEL = "pt-BR_BroadbandModel"; /** pt-BR_Multimedia. */ diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CustomWord.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CustomWord.java index b1b79fe23b7..ced6c0ff1fa 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CustomWord.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/CustomWord.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAcousticModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAcousticModelOptions.java index e4f2c70e942..0ae5fa6aa46 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAcousticModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAcousticModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAudioOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAudioOptions.java index 0a3c8e43edc..3000e4b7fd6 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAudioOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteAudioOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteCorpusOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteCorpusOptions.java index 840f6f83992..38da85caf58 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteCorpusOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteCorpusOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteGrammarOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteGrammarOptions.java index 3a762373213..d0ea19aae03 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteGrammarOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteGrammarOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteJobOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteJobOptions.java index a423d014292..5c8b627c4df 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteJobOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteJobOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteLanguageModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteLanguageModelOptions.java index c1d059c043a..4b62168fa7c 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteLanguageModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteLanguageModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteUserDataOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteUserDataOptions.java index af01bac6b22..5ec4a6e2f81 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteUserDataOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteUserDataOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteWordOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteWordOptions.java index 8d939654188..66a05516390 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteWordOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/DeleteWordOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAcousticModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAcousticModelOptions.java index d06aa52ed66..db822dc80db 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAcousticModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAcousticModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAudioOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAudioOptions.java index 90b3297ca0c..a729388fa79 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAudioOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetAudioOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetCorpusOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetCorpusOptions.java index c2273f7b57a..90c113454a8 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetCorpusOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetCorpusOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetGrammarOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetGrammarOptions.java index a1e52d778fc..b401ae65612 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetGrammarOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetGrammarOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetLanguageModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetLanguageModelOptions.java index 0889276c828..900ac96b2eb 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetLanguageModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetLanguageModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetModelOptions.java index 26ff76eb4a4..c5ea73ef0d4 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -74,18 +75,26 @@ public interface ModelId { String EN_US_TELEPHONY = "en-US_Telephony"; /** en-WW_Medical_Telephony. */ String EN_WW_MEDICAL_TELEPHONY = "en-WW_Medical_Telephony"; + /** es-AR. */ + String ES_AR = "es-AR"; /** es-AR_BroadbandModel. */ String ES_AR_BROADBANDMODEL = "es-AR_BroadbandModel"; /** es-AR_NarrowbandModel. */ String ES_AR_NARROWBANDMODEL = "es-AR_NarrowbandModel"; + /** es-CL. */ + String ES_CL = "es-CL"; /** es-CL_BroadbandModel. */ String ES_CL_BROADBANDMODEL = "es-CL_BroadbandModel"; /** es-CL_NarrowbandModel. */ String ES_CL_NARROWBANDMODEL = "es-CL_NarrowbandModel"; + /** es-CO. */ + String ES_CO = "es-CO"; /** es-CO_BroadbandModel. */ String ES_CO_BROADBANDMODEL = "es-CO_BroadbandModel"; /** es-CO_NarrowbandModel. */ String ES_CO_NARROWBANDMODEL = "es-CO_NarrowbandModel"; + /** es-ES. */ + String ES_ES = "es-ES"; /** es-ES_BroadbandModel. */ String ES_ES_BROADBANDMODEL = "es-ES_BroadbandModel"; /** es-ES_NarrowbandModel. */ @@ -96,10 +105,14 @@ public interface ModelId { String ES_ES_TELEPHONY = "es-ES_Telephony"; /** es-LA_Telephony. */ String ES_LA_TELEPHONY = "es-LA_Telephony"; + /** es-MX. */ + String ES_MX = "es-MX"; /** es-MX_BroadbandModel. */ String ES_MX_BROADBANDMODEL = "es-MX_BroadbandModel"; /** es-MX_NarrowbandModel. */ String ES_MX_NARROWBANDMODEL = "es-MX_NarrowbandModel"; + /** es-PE. */ + String ES_PE = "es-PE"; /** es-PE_BroadbandModel. */ String ES_PE_BROADBANDMODEL = "es-PE_BroadbandModel"; /** es-PE_NarrowbandModel. */ @@ -162,6 +175,8 @@ public interface ModelId { String NL_NL_NARROWBANDMODEL = "nl-NL_NarrowbandModel"; /** nl-NL_Telephony. */ String NL_NL_TELEPHONY = "nl-NL_Telephony"; + /** pt-BR. */ + String PT_BR = "pt-BR"; /** pt-BR_BroadbandModel. */ String PT_BR_BROADBANDMODEL = "pt-BR_BroadbandModel"; /** pt-BR_Multimedia. */ diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetWordOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetWordOptions.java index 55dcc3e1bfa..524cd1a8558 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetWordOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/GetWordOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammar.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammar.java index c08a0dc933a..8a25e68554a 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammar.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammar.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammars.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammars.java index 107395c9cdb..7422e9a85e5 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammars.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Grammars.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/KeywordResult.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/KeywordResult.java index a32341fa9b6..fe90e3cd122 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/KeywordResult.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/KeywordResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModel.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModel.java index 02aa2b806f3..ab0193e50c0 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModel.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModels.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModels.java index 75bc04748a5..c26a36ca848 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModels.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/LanguageModels.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAcousticModelsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAcousticModelsOptions.java index efc74c89f9f..75b5d54c6fe 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAcousticModelsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAcousticModelsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAudioOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAudioOptions.java index de1a6bf0bcb..46a7039e15c 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAudioOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListAudioOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListCorporaOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListCorporaOptions.java index d4fabffa107..16c14e53d85 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListCorporaOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListCorporaOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListGrammarsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListGrammarsOptions.java index a76ea0f4333..e60400e45ba 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListGrammarsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListGrammarsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListLanguageModelsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListLanguageModelsOptions.java index 05b4302285b..0351b5fa6c0 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListLanguageModelsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListLanguageModelsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListModelsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListModelsOptions.java index a07dac6acfa..e85ed232e1d 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListModelsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListModelsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListWordsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListWordsOptions.java index 6f387b2a542..189430c56c0 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListWordsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ListWordsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessedAudio.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessedAudio.java index 35e59400c2e..13909777a86 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessedAudio.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessedAudio.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessingMetrics.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessingMetrics.java index e85c1a1278a..f67da215252 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessingMetrics.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ProcessingMetrics.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJob.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJob.java index 5bae0b89831..08ac9875f2e 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJob.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJob.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2016, 2023. + * (C) Copyright IBM Corp. 2016, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJobs.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJobs.java index 5a26f09bf63..89280df2bc1 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJobs.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognitionJobs.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeOptions.java index 443c176c3a3..ce7689934b7 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; @@ -89,18 +90,26 @@ public interface Model { String EN_US_TELEPHONY = "en-US_Telephony"; /** en-WW_Medical_Telephony. */ String EN_WW_MEDICAL_TELEPHONY = "en-WW_Medical_Telephony"; + /** es-AR. */ + String ES_AR = "es-AR"; /** es-AR_BroadbandModel. */ String ES_AR_BROADBANDMODEL = "es-AR_BroadbandModel"; /** es-AR_NarrowbandModel. */ String ES_AR_NARROWBANDMODEL = "es-AR_NarrowbandModel"; + /** es-CL. */ + String ES_CL = "es-CL"; /** es-CL_BroadbandModel. */ String ES_CL_BROADBANDMODEL = "es-CL_BroadbandModel"; /** es-CL_NarrowbandModel. */ String ES_CL_NARROWBANDMODEL = "es-CL_NarrowbandModel"; + /** es-CO. */ + String ES_CO = "es-CO"; /** es-CO_BroadbandModel. */ String ES_CO_BROADBANDMODEL = "es-CO_BroadbandModel"; /** es-CO_NarrowbandModel. */ String ES_CO_NARROWBANDMODEL = "es-CO_NarrowbandModel"; + /** es-ES. */ + String ES_ES = "es-ES"; /** es-ES_BroadbandModel. */ String ES_ES_BROADBANDMODEL = "es-ES_BroadbandModel"; /** es-ES_NarrowbandModel. */ @@ -111,10 +120,14 @@ public interface Model { String ES_ES_TELEPHONY = "es-ES_Telephony"; /** es-LA_Telephony. */ String ES_LA_TELEPHONY = "es-LA_Telephony"; + /** es-MX. */ + String ES_MX = "es-MX"; /** es-MX_BroadbandModel. */ String ES_MX_BROADBANDMODEL = "es-MX_BroadbandModel"; /** es-MX_NarrowbandModel. */ String ES_MX_NARROWBANDMODEL = "es-MX_NarrowbandModel"; + /** es-PE. */ + String ES_PE = "es-PE"; /** es-PE_BroadbandModel. */ String ES_PE_BROADBANDMODEL = "es-PE_BroadbandModel"; /** es-PE_NarrowbandModel. */ @@ -177,6 +190,8 @@ public interface Model { String NL_NL_NARROWBANDMODEL = "nl-NL_NarrowbandModel"; /** nl-NL_Telephony. */ String NL_NL_TELEPHONY = "nl-NL_Telephony"; + /** pt-BR. */ + String PT_BR = "pt-BR"; /** pt-BR_BroadbandModel. */ String PT_BR_BROADBANDMODEL = "pt-BR_BroadbandModel"; /** pt-BR_Multimedia. */ diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeWithWebsocketsOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeWithWebsocketsOptions.java index bcc2129eaec..6d6f85a5175 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeWithWebsocketsOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RecognizeWithWebsocketsOptions.java @@ -201,7 +201,9 @@ public interface Model { protected Boolean splitTranscriptAtPhraseEnd; protected Float speechDetectorSensitivity; protected Float backgroundAudioSuppression; + protected Boolean lowLatency; protected Float characterInsertionBias; + private Boolean interimResults; private Boolean processingMetrics; private Float processingMetricsInterval; @@ -232,7 +234,9 @@ public static class Builder { private Boolean splitTranscriptAtPhraseEnd; private Float speechDetectorSensitivity; private Float backgroundAudioSuppression; + private Boolean lowLatency; private Float characterInsertionBias; + private Boolean interimResults; private Boolean processingMetrics; private Float processingMetricsInterval; @@ -262,7 +266,9 @@ private Builder(RecognizeWithWebsocketsOptions recognizeWithWebsocketsOptions) { this.splitTranscriptAtPhraseEnd = recognizeWithWebsocketsOptions.splitTranscriptAtPhraseEnd; this.speechDetectorSensitivity = recognizeWithWebsocketsOptions.speechDetectorSensitivity; this.backgroundAudioSuppression = recognizeWithWebsocketsOptions.backgroundAudioSuppression; + this.lowLatency = recognizeWithWebsocketsOptions.lowLatency; this.characterInsertionBias = recognizeWithWebsocketsOptions.characterInsertionBias; + this.interimResults = recognizeWithWebsocketsOptions.interimResults; this.processingMetrics = recognizeWithWebsocketsOptions.processingMetrics; this.processingMetricsInterval = recognizeWithWebsocketsOptions.processingMetricsInterval; } @@ -578,6 +584,17 @@ public Builder backgroundAudioSuppression(Float backgroundAudioSuppression) { return this; } + /** + * Set the lowLatency. + * + * @param lowLatency the lowLatency + * @return the RecognizeOptions builder + */ + public Builder lowLatency(Boolean lowLatency) { + this.lowLatency = lowLatency; + return this; + } + /** * Set the characterInsertionBias. * @@ -589,6 +606,19 @@ public Builder characterInsertionBias(Float characterInsertionBias) { return this; } + /** + * Set the interimResults. + * + *

NOTE: This parameter only works for the `recognizeUsingWebSocket` method. + * + * @param interimResults the interimResults + * @return the interimResults + */ + public Builder interimResults(Boolean interimResults) { + this.interimResults = interimResults; + return this; + } + /** * Set the audio. * @@ -655,7 +685,9 @@ protected RecognizeWithWebsocketsOptions(Builder builder) { splitTranscriptAtPhraseEnd = builder.splitTranscriptAtPhraseEnd; speechDetectorSensitivity = builder.speechDetectorSensitivity; backgroundAudioSuppression = builder.backgroundAudioSuppression; + lowLatency = builder.lowLatency; characterInsertionBias = builder.characterInsertionBias; + interimResults = builder.interimResults; processingMetrics = builder.processingMetrics; processingMetricsInterval = builder.processingMetricsInterval; } @@ -1091,6 +1123,28 @@ public Float backgroundAudioSuppression() { return backgroundAudioSuppression; } + /** + * Gets the lowLatency. + * + *

If `true` for next-generation `Multimedia` and `Telephony` models that support low latency, + * directs the service to produce results even more quickly than it usually does. Next-generation + * models produce transcription results faster than previous-generation models. The `low_latency` + * parameter causes the models to produce results even more quickly, though the results might be + * less accurate when the parameter is used. + * + *

The parameter is not available for previous-generation `Broadband` and `Narrowband` models. + * It is available for most next-generation models. * For a list of next-generation models that + * support low latency, see [Supported next-generation language + * models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng#models-ng-supported). + * * For more information about the `low_latency` parameter, see [Low + * latency](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interim#low-latency). + * + * @return the lowLatency + */ + public Boolean lowLatency() { + return lowLatency; + } + /** * Gets the characterInsertionBias. * @@ -1122,6 +1176,21 @@ public Float characterInsertionBias() { return characterInsertionBias; } + /** + * Gets the interimResults. + * + *

If `true`, the service returns interim results as a stream of `SpeechRecognitionResults` + * objects. By default, the service returns a single `SpeechRecognitionResults` object with final + * results only. + * + *

NOTE: This parameter only works for the `recognizeUsingWebSocket` method. + * + * @return the interimResults + */ + public Boolean interimResults() { + return interimResults; + } + /** * Gets the processingMetrics. * diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterCallbackOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterCallbackOptions.java index 7f3628fd9c9..ed05bba31c9 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterCallbackOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterCallbackOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterStatus.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterStatus.java index 853115034ac..c9fe53a67a5 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterStatus.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/RegisterStatus.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetAcousticModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetAcousticModelOptions.java index ec1e6d83d15..041a3d36884 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetAcousticModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetAcousticModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetLanguageModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetLanguageModelOptions.java index 0f33556fc91..99459ac4926 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetLanguageModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/ResetLanguageModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeakerLabelsResult.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeakerLabelsResult.java index 4df2f898451..e362991b47c 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeakerLabelsResult.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeakerLabelsResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModel.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModel.java index 09c9c556ffe..9224f2242af 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModel.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2016, 2023. + * (C) Copyright IBM Corp. 2016, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModels.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModels.java index 8a6770c140d..67892178f44 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModels.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechModels.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionAlternative.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionAlternative.java index 21d6b55939d..419433566aa 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionAlternative.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionAlternative.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResult.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResult.java index 874dc8605f6..79c7e0e3cd7 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResult.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResults.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResults.java index 873221235cd..b9f3be382a5 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResults.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SpeechRecognitionResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SupportedFeatures.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SupportedFeatures.java index c250d49455d..61225ffbbd4 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SupportedFeatures.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/SupportedFeatures.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainAcousticModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainAcousticModelOptions.java index d1f7ee2ff68..00d5dce54fa 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainAcousticModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainAcousticModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainLanguageModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainLanguageModelOptions.java index 2ca530c64e9..2aaaf3f2c1a 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainLanguageModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainLanguageModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingResponse.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingResponse.java index 14213b48da1..20696e168cb 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingResponse.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingResponse.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingWarning.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingWarning.java index aaae37115d8..3eea674224f 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingWarning.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/TrainingWarning.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UnregisterCallbackOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UnregisterCallbackOptions.java index 4f5aa76b61f..b4f454b1126 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UnregisterCallbackOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UnregisterCallbackOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeAcousticModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeAcousticModelOptions.java index 29905635d6c..3ccf0004db7 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeAcousticModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeAcousticModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeLanguageModelOptions.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeLanguageModelOptions.java index 84a7d22c962..290c36e1aaa 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeLanguageModelOptions.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/UpgradeLanguageModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Word.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Word.java index 7efb5894e8a..64caa9b77c2 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Word.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Word.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResult.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResult.java index b4c28972b03..038ebde53d1 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResult.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResult.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResults.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResults.java index b2a8991e105..6654d4ffd5b 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResults.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordAlternativeResults.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordError.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordError.java index 592d4d40400..2bcc38ad3f9 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordError.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/WordError.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Words.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Words.java index a7514922483..faa1e435f05 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Words.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/model/Words.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/package-info.java b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/package-info.java index 30434f58d3e..5d4cd287ed1 100644 --- a/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/package-info.java +++ b/speech-to-text/src/main/java/com/ibm/watson/speech_to_text/v1/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,5 +10,6 @@ * 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. */ + /** Speech to Text v1. */ package com.ibm.watson.speech_to_text.v1; diff --git a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java index 076c7c42a72..1d612850ce0 100755 --- a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java +++ b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextIT.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2024. + * (C) Copyright IBM Corp. 2019, 2022. * * 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 @@ -347,6 +347,7 @@ public void testRecognizeWebSocket() throws FileNotFoundException, InterruptedEx .wordAlternativesThreshold(0.5f) .model(EN_BROADBAND16K) .contentType(HttpMediaType.AUDIO_WAV) + .interimResults(true) .processingMetrics(true) .processingMetricsInterval(0.2f) .audioMetrics(true) diff --git a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextTest.java b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextTest.java index 4f6dbc7d02f..64e1dcbd1ea 100755 --- a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextTest.java +++ b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/SpeechToTextTest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1; import static org.testng.Assert.*; diff --git a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/utils/TestUtilities.java b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/utils/TestUtilities.java index 5074c91f25e..57695908719 100644 --- a/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/utils/TestUtilities.java +++ b/speech-to-text/src/test/java/com/ibm/watson/speech_to_text/v1/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.speech_to_text.v1.utils; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -18,6 +19,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; +import java.util.Base64; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -114,8 +116,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception { diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/TextToSpeech.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/TextToSpeech.java index 67addf83d88..7f77f707438 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/TextToSpeech.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/TextToSpeech.java @@ -12,7 +12,7 @@ */ /* - * IBM OpenAPI SDK Code Generator Version: 3.85.0-75c38f8f-20240206-210220 + * IBM OpenAPI SDK Code Generator Version: 3.97.0-0e90eab1-20241120-170029 */ package com.ibm.watson.text_to_speech.v1; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddCustomPromptOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddCustomPromptOptions.java index 39f00983418..17fad790a93 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddCustomPromptOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddCustomPromptOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordOptions.java index daabc44a1c7..2019a77f488 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordsOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordsOptions.java index 365a8ecc378..53407fc0c94 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordsOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/AddWordsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateCustomModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateCustomModelOptions.java index 48c91744200..694c69c911c 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateCustomModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateCustomModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateSpeakerModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateSpeakerModelOptions.java index 5938b0a35ae..4309b4911de 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateSpeakerModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CreateSpeakerModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModel.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModel.java index 966b8cd9be0..20d9c97161f 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModel.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModels.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModels.java index aa7fc3190af..a4d6639a5ba 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModels.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/CustomModels.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomModelOptions.java index ab0bd5b4f60..f42a289a06d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomPromptOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomPromptOptions.java index 22aaedba00e..2f784782043 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomPromptOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteCustomPromptOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteSpeakerModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteSpeakerModelOptions.java index 4e0bfa63a6d..0c0d92ccf76 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteSpeakerModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteSpeakerModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteUserDataOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteUserDataOptions.java index a2f4effd354..fa61d47dce8 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteUserDataOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteUserDataOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteWordOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteWordOptions.java index d5cbeae592f..59e067532a4 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteWordOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/DeleteWordOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomModelOptions.java index 53a755114ac..7dc78c7533c 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020, 2023. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomPromptOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomPromptOptions.java index 1f3c43f2ac7..8bb49f1e94a 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomPromptOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetCustomPromptOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetPronunciationOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetPronunciationOptions.java index 7b7a57bb0c7..1ba747a45d3 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetPronunciationOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetPronunciationOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetSpeakerModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetSpeakerModelOptions.java index 75bc0729ab6..bb8402d2b6b 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetSpeakerModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetSpeakerModelOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetVoiceOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetVoiceOptions.java index 824a54cdbb1..94386e13f8b 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetVoiceOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetVoiceOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetWordOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetWordOptions.java index 08c43a903f8..e81545b6fff 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetWordOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/GetWordOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomModelsOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomModelsOptions.java index 9f1ec46664b..643feba2c7d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomModelsOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomModelsOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomPromptsOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomPromptsOptions.java index ddd50aa3041..a4cfca8f049 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomPromptsOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListCustomPromptsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListSpeakerModelsOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListSpeakerModelsOptions.java index 6d965520d90..6901eaa50f0 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListSpeakerModelsOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListSpeakerModelsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListVoicesOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListVoicesOptions.java index 1b3d89a5007..137036c253d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListVoicesOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListVoicesOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListWordsOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListWordsOptions.java index 308f7ee79cd..83e345099e9 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListWordsOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/ListWordsOptions.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2018, 2023. + * (C) Copyright IBM Corp. 2018, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompt.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompt.java index 7efc75d8f3a..1eb893e17ed 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompt.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompt.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/PromptMetadata.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/PromptMetadata.java index bbe98a49e5d..5c7988a0960 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/PromptMetadata.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/PromptMetadata.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompts.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompts.java index a27d0b5a462..f782e207a5d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompts.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Prompts.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Pronunciation.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Pronunciation.java index 9323f46d2ce..8d57c9c8de2 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Pronunciation.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Pronunciation.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speaker.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speaker.java index 94fbca22c16..7007445894d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speaker.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speaker.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModel.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModel.java index e1429f26c13..e4216bd8598 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModel.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModels.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModels.java index 8a3f039c2c2..1895460def9 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModels.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerCustomModels.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerModel.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerModel.java index 8ff32321521..e2492ded6f2 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerModel.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerModel.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerPrompt.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerPrompt.java index 035417c98f0..504e5bad582 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerPrompt.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SpeakerPrompt.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speakers.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speakers.java index 66786bac46e..a12dae5de1b 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speakers.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Speakers.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2021, 2023. + * (C) Copyright IBM Corp. 2021, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SupportedFeatures.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SupportedFeatures.java index 9d02e305f64..f947ee3e8cb 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SupportedFeatures.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SupportedFeatures.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SynthesizeOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SynthesizeOptions.java index 3c939c7a6cb..bd2b05e141d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SynthesizeOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/SynthesizeOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Translation.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Translation.java index 431532ac33e..a2cc889579d 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Translation.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Translation.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/UpdateCustomModelOptions.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/UpdateCustomModelOptions.java index 05c7a94a035..29511013244 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/UpdateCustomModelOptions.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/UpdateCustomModelOptions.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voice.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voice.java index d1fdec1c85c..83c6966203a 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voice.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voice.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2016, 2023. + * (C) Copyright IBM Corp. 2016, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voices.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voices.java index 728416d35bb..0d8d23cddc9 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voices.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Voices.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2023. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Word.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Word.java index cee523fe5f7..122155a54b6 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Word.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Word.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.google.gson.annotations.SerializedName; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Words.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Words.java index 91836506f46..2ad52030012 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Words.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/model/Words.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.model; import com.ibm.cloud.sdk.core.service.model.GenericModel; diff --git a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/package-info.java b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/package-info.java index 341d1963131..276bcf449e5 100644 --- a/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/package-info.java +++ b/text-to-speech/src/main/java/com/ibm/watson/text_to_speech/v1/package-info.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2019, 2020. + * (C) Copyright IBM Corp. 2019, 2024. * * 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 @@ -10,5 +10,6 @@ * 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. */ + /** Text to Speech v1. */ package com.ibm.watson.text_to_speech.v1; diff --git a/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/TextToSpeechTest.java b/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/TextToSpeechTest.java index 054b4471b20..856b34c6f77 100644 --- a/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/TextToSpeechTest.java +++ b/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/TextToSpeechTest.java @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1; import static org.testng.Assert.*; @@ -213,9 +214,9 @@ public void testSynthesizeWOptions() throws Throwable { Response response = textToSpeechService.synthesize(synthesizeOptionsModel).execute(); assertNotNull(response); - InputStream responseObj = response.getResult(); - assertNotNull(responseObj); - responseObj.close(); + try (InputStream responseObj = response.getResult(); ) { + assertNotNull(responseObj); + } // Verify the contents of the request sent to the mock server RecordedRequest request = server.takeRequest(); diff --git a/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/utils/TestUtilities.java b/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/utils/TestUtilities.java index 22c7e5c65a0..2bef2503ebc 100644 --- a/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/utils/TestUtilities.java +++ b/text-to-speech/src/test/java/com/ibm/watson/text_to_speech/v1/utils/TestUtilities.java @@ -1,5 +1,5 @@ /* - * (C) Copyright IBM Corp. 2020. + * (C) Copyright IBM Corp. 2020, 2024. * * 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 @@ -10,6 +10,7 @@ * 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.ibm.watson.text_to_speech.v1.utils; import com.ibm.cloud.sdk.core.service.model.FileWithMetadata; @@ -18,6 +19,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; +import java.util.Base64; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -114,8 +116,8 @@ public static List creatMockListFileWithMetadata() { return list; } - public static byte[] createMockByteArray(String bytes) { - return bytes.getBytes(); + public static byte[] createMockByteArray(String encodedString) throws Exception { + return Base64.getDecoder().decode(encodedString); } public static Date createMockDate(String date) throws Exception {