Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sdk major release 2024 #1230

Merged
merged 12 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -46,20 +44,14 @@ 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 }}
DISCOVERY_V2_URL: "https://api.us-south.discovery.watson.cloud.ibm.com"
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
Expand Down
50 changes: 0 additions & 50 deletions MIGRATION-V11.md

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -144,23 +144,23 @@ Builder pattern approach:
Authenticator authenticator = new IamAuthenticator.Builder()
.apikey("<iam_api_key>")
.build();
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

Deprecated constructor approach:

```java
// letting the SDK manage the IAM token
Authenticator authenticator = new IamAuthenticator("<iam_api_key>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

Supplying the access token:

```java
// assuming control of managing IAM token
Authenticator authenticator = new BearerTokenAuthenticator("<access_token>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

#### Username and password
Expand All @@ -172,22 +172,22 @@ Authenticator authenticator = new BasicAuthenticator.Builder()
.username("<username>")
.password("<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("<username>", "<password>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

#### ICP
Authenticating with ICP is similar to the basic username and password method, except that you need to make sure to disable SSL verification to authenticate properly. See [here](#configuring-the-http-client) for more information.

```java
Authenticator authenticator = new BasicAuthenticator("<username>", "<password>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);

HttpConfigOptions options = new HttpConfigOptions.Builder()
.disableSslVerification(true)
Expand All @@ -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("<service CP4D URL>");
```

Expand All @@ -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("<service CP4D URL>");
```

```java
// assuming control of managing the access token
Authenticator authenticator = new BearerTokenAuthenticator("<access_token>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
service.setServiceUrl("<service CP4D URL>");
```

Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<img alt="Bintray sync" width="600" src="./.github/bintray-sync.png">
Expand Down
5 changes: 5 additions & 0 deletions assistant/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.launchdarkly</groupId>
<artifactId>okhttp-eventsource</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand All @@ -21,6 +22,8 @@
/**
* State information for the conversation. To maintain state, include the context from the previous
* response.
*
* <p>This type supports additional properties of type Object. Any context variable.
*/
public class Context extends DynamicModel<Object> {

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +10,7 @@
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 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;
Expand Down
Loading
Loading