diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000000..10756a01aa0 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,49 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "lpatino10", + "name": "Logan Patino", + "avatar_url": "https://avatars2.githubusercontent.com/u/8710772?v=4", + "profile": "https://www.linkedin.com/in/logan-patino/", + "contributions": [ + "code", + "design", + "bug" + ] + }, + { + "login": "mediumTaj", + "name": "Ajiemar Santiago", + "avatar_url": "https://avatars1.githubusercontent.com/u/4381558?v=4", + "profile": "https://github.com/mediumTaj", + "contributions": [ + "code", + "design", + "bug" + ] + }, + { + "login": "germanattanasio", + "name": "German Attanasio", + "avatar_url": "https://avatars3.githubusercontent.com/u/313157?v=4", + "profile": "https://germanattanasio.com", + "contributions": [ + "code", + "design", + "doc", + "test" + ] + } + ], + "contributorsPerLine": 7, + "projectName": "java-sdk", + "projectOwner": "watson-developer-cloud", + "repoType": "github", + "repoHost": "https://github.com", + "skipCi": true +} diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 78eac6a6927..24d4fd8c2f4 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,29 +1,22 @@ [bumpversion] -current_version = 6.1.0 +current_version = 16.1.0 +commit = True +message = Update version numbers from {current_version} -> {new_version} +search = {current_version} +replace = {new_version} [bumpversion:file:README.md] [bumpversion:file:assistant/README.md] -[bumpversion:file:conversation/README.md] - [bumpversion:file:discovery/README.md] -[bumpversion:file:language-translator/README.md] - -[bumpversion:file:natural-language-classifier/README.md] - [bumpversion:file:natural-language-understanding/README.md] -[bumpversion:file:personality-insights/README.md] - [bumpversion:file:speech-to-text/README.md] [bumpversion:file:text-to-speech/README.md] -[bumpversion:file:tone-analyzer/README.md] - -[bumpversion:file:visual-recognition/README.md] -search = {current_version} -replace = {new_version} +[bumpversion:file:docker/pom.xml] +[bumpversion:file:.github/workflows/deploy.yml] diff --git a/.github/.github/stale.yml b/.github/.github/stale.yml new file mode 100644 index 00000000000..6582de497e6 --- /dev/null +++ b/.github/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - bug + - feature +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 923748e6a3a..ba2daa61be4 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at germanattanasio@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at loganpatino10@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f33a1283229..4736f1db669 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,27 +1,32 @@ -# Questions - -If you are having difficulties using the APIs or have a question about the IBM Watson Services, -please ask a question on [dW Answers][dw] or [Stack Overflow][stackoverflow]. - # Issues If you encounter an issue with the Java SDK, you are welcome to submit a [bug report](https://github.com/watson-developer-cloud/java-sdk/issues). Before that, please search for similar issues. It's possible somebody has encountered this issue already. +# Building and testing +This project uses [Maven] as the build tool (> v1.x). Here are some helpful commands: +```sh +cd java-sdk +mvn clean # Delete target directory. +mvn test # Run tests +mvn package # Take the compiled code and package it in its distributable format, e.g. JAR. +mvn verify # Run any checks to verify the MVN package is valid and meets quality criteria. +mvn verify -fae -DskipITs=false # Run Integration tests to verify the MVN package is valid and meets quality criteria. +mvn install # Install the package into the local maven repository cache. +``` + # Pull Requests If you want to contribute to the repository, here's a quick guide: 1. Fork the repository - 1. Create a `.config.properties` similar to [`config.properties`](https://github.com/watson-developer-cloud/java-sdk/blob/master/core/src/test/resources/config.properties). - 2. develop and test your code changes, gradle: `gradle test`. - * Run `checkstyle`: `gradle checkstyle`. 🏁 + 1. Edit the [`config.properties`](../common/src/test/resources/config.properties) file to add your service credentials to the appropriate fields. + 2. develop and test your code changes: `mvn verify -fae -DskipITs=false`. + * Run `checkstyle`: `mvn checkstyle:check`. 🏁 * Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change. * Check for unnecessary whitespace with git diff --check before committing. 3. Make the test pass 4. Commit your changes: - * Use the present tense (`"Add feature"` not `"Added Feature"`) - * Use the imperative mood (`"Move cursor to…"` not `"Moves cursor to…"`) - * Include relevant Emoji from our [Emoji cheatsheet](#emoji-cheatsheet) + * Commits should follow the [Angular commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines). This is because our release tool uses this format for determining release versions and generating changelogs. To make this easier, we recommend using the [Commitizen CLI](https://github.com/commitizen/cz-cli) with the `cz-conventional-changelog` adapter. 5. Push to your fork and submit a pull request to the **master** branch # Developer's Certificate of Origin 1.1 @@ -50,24 +55,6 @@ By making a contribution to this project, I certify that: maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -## Emoji Cheatsheet - -When creating creating commits or updating the `CHANGELOG`, please **start** the commit message or update with one of the following applicable Emoji. Emoji should not be used at the start of issue or pull request titles. - -* :new: `:new:` when adding new functionality -* :bug: `:bug:` when fixing a bug -* :memo: `:memo:` when writing documentation -* :art: `:art:` when improving the format/structure of the code -* :fire: `:fire:` when removing code or files -* :racehorse: `:racehorse:` when improving performance -* :white_check_mark: `:white_check_mark:` when adding tests -* :green_heart: `:green_heart:` when fixing the CI build -* :lock: `:lock:` when dealing with security -* :crystal_ball: `:crystal_ball:` when experimenting -* :unamused: `:unamused:` when doing chore work (updating dependencies, etc…) -* :boom: `:boom:` when changing in a non-backwards-compatible way current functionality -* :shipit: `:shipit:` when creating a new release - ## Additional Resources + [General GitHub documentation](https://help.github.com/) + [GitHub pull request documentation](https://help.github.com/send-pull-requests/) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..3e991949e71 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,44 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-watson+java). + +Before you open an issue, please check if a similar issue already exists or has been closed before. + +**Check service status** + +1. For service issues or 5xx errors, first, go to the [IBM Cloud status page](https://cloud.ibm.com/status?component=compare-comply%2Cdiscovery%2Cconversation%2Cwatson-vision-combined%2Cnatural-language-understanding%2Cnatural-language-classifier%2Clanguage-translator%2Cpersonality-insights%2Cspeech-to-text%2Ctext-to-speech%2Ctone-analyzer&selected=status) and check the status of the service. +1. If the service status is OK, continue with a bug report. + +--- + +**Overview** +_What is the issue? Be concise and clear._ + +**Expected behavior** +_What did you expect to happen?_ + +**Actual behavior** +_What actually happened?_ + +**How to reproduce** +_Help us to reproduce what you experienced. Include your code snippets (without credentials)_ + +**Screenshots** +_If applicable, add screenshots to help explain your problem._ + +**SDK Version** +_Please provide the SDK version here._ + +**Additional information:** +- OS: _for example, iOS_ +- Which version of `Java` are you using? + +**Additional context** +_Add any other details about the problem._ diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..0f47a4dc643 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-watson+java). + +Before you open an issue, please check if a similar issue already exists or has been closed before. + +### When you open an issue for a feature request, please add as much detail as possible: + +- [ ] A descriptive title starting with the service name +- [ ] A description of the problem you're trying to solve +- [ ] A suggested solution if possible diff --git a/.github/bintray-new-version.png b/.github/bintray-new-version.png new file mode 100644 index 00000000000..76850dd9d14 Binary files /dev/null and b/.github/bintray-new-version.png differ diff --git a/.github/bintray-sync.png b/.github/bintray-sync.png new file mode 100644 index 00000000000..13e4dadb327 Binary files /dev/null and b/.github/bintray-sync.png differ diff --git a/.github/bintray-upload-files.png b/.github/bintray-upload-files.png new file mode 100644 index 00000000000..6024c834dae Binary files /dev/null and b/.github/bintray-upload-files.png differ diff --git a/.github/issue_template.md b/.github/issue_template.md index c9c2e173746..c62e3dfece2 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,4 +1,4 @@ -Remember, an issue is not the place to ask questions. You can use [Stack Overflow](http://stackoverflow.com/questions/tagged/ibm-watson) for that, or you may want to start a discussion on the [dW Answers](https://developer.ibm.com/answers/questions/ask/?topics=watson). +Remember, an issue is not the place to ask questions. If you have issues with the APIs or have a question about the Watson services, see [Stack Overflow](https://stackoverflow.com/questions/tagged/ibm-watson+java). Before you open an issue, please check if a similar issue already exists or has been closed before. diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000000..e3e4aac1495 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has had no + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 00000000000..5c51075c04f --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,48 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support documentation. +# This workflow will do a clean install of java dependencies, build the source code and run tests across different versions of java +# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven + +name: Build and Test + +on: + push: + branches: [ '**' ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build_test: + name: Build and Test on Java ${{ matrix.java-version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + java-version: ['8'] + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java-version }} + distribution: 'adopt' + + - name: Install Java dependencies + run: curl -s https://codecov.io/bash > $HOME/codecov-bash.sh && chmod +x $HOME/codecov-bash.sh + + - name: Execute Java unit tests + env: + MVN_ARGS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + run: mvn verify -fae -DskipITs $MVN_ARGS + + - name: Publish Java code coverage + if: github.ref == 'refs/heads/master' + env: + CC_TOK: ${{ secrets.CODECOV_TOKEN }} + run: $HOME/codecov-bash.sh -s modules/coverage-reports/target/site/jacoco-aggregate -t $CC_TOK diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000000..44b8d64f76e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,122 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support documentation. +# This workflow will download a prebuilt Java version, install dependencies, build and deploy/publish a new release +# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-java-with-maven + +name: Deploy and Publish + +on: + workflow_run: + workflows: ["Build and Test"] + branches: [ master ] + types: + - completed + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + deploy: + if: "!contains(github.event.head_commit.message, 'skip ci')" + name: Deploy and Publish + env: + MVN_ARGS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.GH_TOKEN }} + persist-credentials: true + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + + - name: Build Java package + run: mvn verify -fae -DskipITs -Dskip.unit.tests $MVN_ARGS + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: 20 + + - name: Install Semantic Release dependencies + run: | + pip3 install --user bump2version + npm install -g semantic-release + npm install -g @semantic-release/changelog + npm install -g @semantic-release/exec + npm install -g @semantic-release/git + npm install -g @semantic-release/github + npm install -g @semantic-release/commit-analyzer + npm install -g @semantic-release/release-notes-generator + + - name: Check if semantic release generated a release + id: is_new_release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + echo "IS_NEW_RELEASE=$(npx semantic-release --dry-run | grep -c -i "Published release")" >> $GITHUB_OUTPUT + echo "The full TAG - ${{ github.ref }}" + + - name: Get the nextRelease.version from semantic release + if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }} + id: next_release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: echo "NEXT_RELEASE=$(npx semantic-release --dry-run | grep -oP "Published release \K[0-9]+\.[0-9]+\.[0-9]+")" >> $GITHUB_OUTPUT + + - name: Publish to Git Releases and Tags + if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '1' }} + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release # --dry-run --branches 9662_addcheck + + - name: Publish to Maven Central + env: + GHA_TAG: "refs/tags/v16.1.0" # for setMavenVersion_gha + CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} # for .travis.settings.xml + CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} + GPG_KEYNAME: ${{ secrets.SIGNING_KEY }} + GPG_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} + SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} # for setupSigning_gha + run: | + echo "The NEXT_RELEASE - ${{ steps.next_release.outputs.NEXT_RELEASE }}" + echo -e "\n\033[0;35mCommand: setupSigning" + build/setupSigning_gha.sh + echo -e "\n\033[0;35mCommand: setMavenVersion" + build/setMavenVersion_gha.sh + echo -e "\n\033[0;35mCommand: mvn deploy" + mvn deploy --settings build/.travis.settings.xml -DskipITs -Dskip.unit.tests -P central $MVN_ARGS + + - name: Publish Java docs + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + GHA_REPO_SLUG: ${{ github.repository }} + GHA_BRANCH: ${{ github.ref }} # non PR only need to get last part + GHA_PULL_REQUEST: ${{ github.event.number }} + GHA_BUILD_NUMBER: ${{ github.run_number }} + GHA_JOB_NUMBER: ${{ github.job_number }} + GHA_COMMIT: ${{ github.sha }} + GHA_TAG: "refs/tags/v16.1.0" # for setMavenVersion_gha + run: | + build/setMavenVersion_gha.sh + mvn clean javadoc:aggregate $MVN_ARGS + build/publish_gha.sh + + - name: SKIP - Publish/Deploy to Git and Maven Central + if: ${{ steps.is_new_release.outputs.IS_NEW_RELEASE == '0' }} + run: | + echo -e "\n\033[0;35mCommand: Skipping the deployment because semantic release has determined there are no relevant changes that warrent a new release.\n" diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 00000000000..426617a7ac9 --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,79 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support documentation. +# This workflow will download a prebuilt Java version, install dependencies and run integration tests + +name: Run Integration Tests + +on: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + integration_test: + name: Build and Run Integration Tests on Java ${{ matrix.java-version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + java-version: ['8'] + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java-version }} + distribution: 'adopt' + + - name: Execute Java integration tests + # continue-on-error: true + env: + MVN_ARGS: '-B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn' + 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 }} + SPEECH_TO_TEXT_URL: "https://api.us-south.speech-to-text.watson.cloud.ibm.com" + SPEECH_TO_TEXT_CUSTOM_ID: ${{ secrets.STT_APIKEY_CUSTOM_ID }} + SPEECH_TO_TEXT_ACOUSTIC_CUSTOM_ID: ${{ secrets.STT_APIKEY_ACOUSTIC_CUSTOM_ID }} + TEXT_TO_SPEECH_APIKEY: ${{ secrets.TTS_APIKEY }} + TEXT_TO_SPEECH_URL: "https://api.us-south.text-to-speech.watson.cloud.ibm.com" + ASSISTANT_APIKEY: ${{ secrets.WA_APIKEY }} + 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_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=v2/DiscoveryIT -DfailIfNoTests=false -pl discovery,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 + mvn test -Dtest=CustomizationsIT -DfailIfNoTests=false -pl text-to-speech,common $MVN_ARGS + + # Do not notify on success. We will leave the code here just in case we decide to switch gears + - name: Notify slack on success + if: false # success() + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel: watson-e2e-tests + status: SUCCESS + color: good + + - name: Notify slack on failure + if: false # failure() + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} + uses: voxmedia/github-action-slack-notify-build@v1 + with: + channel: watson-e2e-tests + status: FAILED + color: danger diff --git a/.gitignore b/.gitignore index 7c7f20ebaaf..220350e7b47 100644 --- a/.gitignore +++ b/.gitignore @@ -5,20 +5,62 @@ .idea .project .settings -build out target bin/ *.iml *.ipr *.iws +config.properties .config.properties .checkstyle .gradletasknamecache docs .swagger-codegen-ignore .vscode/ -conversation/src/test/java/com/ibm/watson/developer_cloud/conversation/v1/ConversationTest.java .swagger-codegen/VERSION *.orig -*.rej \ No newline at end of file +*.rej +compare-comply/src/test/resources/compare_comply/cloud-object-storage-credentials-input.json +compare-comply/src/test/resources/compare_comply/cloud-object-storage-credentials-output.json +secrets.tar +package-lock.json +model_result.mlmodel +.openapi-generator-ignore +.openapi-generator/ +package-lock.json +.pre-commit-config.yaml +.secrets.baseline +*.test-metadata.txt +*.py +fix-copyrights.sh +/.utility/secring.gpg +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +/**/target/ +/**/test-output/ +.settings/ +.factorypath +*-apiref.json + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar +*.key + +/node_modules \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000000..5fe2ab68c63 --- /dev/null +++ b/.releaserc @@ -0,0 +1,23 @@ +{ + "debug": true, + "branches": [ "master" ], + "tagFormat": "v${version}", + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + [ + "@semantic-release/exec", + { + "prepareCmd": "bump2version --allow-dirty --current-version ${lastRelease.version} --new-version ${nextRelease.version} patch" + } + ], + [ + "@semantic-release/git", + { + "message": "chore(release): ${nextRelease.version} release notes\n\n${nextRelease.notes}" + } + ], + "@semantic-release/github" + ] +} \ No newline at end of file diff --git a/.secrets.baseline b/.secrets.baseline new file mode 100644 index 00000000000..63e7fc50b13 --- /dev/null +++ b/.secrets.baseline @@ -0,0 +1,122 @@ +{ + "exclude": { + "files": "package-lock.json|credentials.json|^.secrets.baseline$", + "lines": null + }, + "generated_at": "2024-02-26T19:16:17Z", + "plugins_used": [ + { + "name": "AWSKeyDetector" + }, + { + "name": "ArtifactoryDetector" + }, + { + "base64_limit": 4.5, + "name": "Base64HighEntropyString" + }, + { + "name": "BasicAuthDetector" + }, + { + "name": "BoxDetector" + }, + { + "name": "CloudantDetector" + }, + { + "ghe_instance": "github.ibm.com", + "name": "GheDetector" + }, + { + "hex_limit": 3, + "name": "HexHighEntropyString" + }, + { + "name": "IbmCloudIamDetector" + }, + { + "name": "IbmCosHmacDetector" + }, + { + "name": "JwtTokenDetector" + }, + { + "keyword_exclude": null, + "name": "KeywordDetector" + }, + { + "name": "MailchimpDetector" + }, + { + "name": "PrivateKeyDetector" + }, + { + "name": "SlackDetector" + }, + { + "name": "SoftlayerDetector" + }, + { + "name": "StripeDetector" + }, + { + "name": "TwilioKeyDetector" + } + ], + "results": { + "CHANGELOG.md": [ + { + "hashed_secret": "939999726d2023fca902233e45790c08081dc91b", + "is_secret": false, + "is_verified": false, + "line_number": 182, + "type": "Hex High Entropy String", + "verified_result": null + } + ], + "assistant/src/test/resources/assistant/assistant.json": [ + { + "hashed_secret": "49568690e3778497671beb117ceecc48e01cdd4c", + "is_secret": false, + "is_verified": false, + "line_number": 117, + "type": "Secret Keyword", + "verified_result": null + } + ], + "assistant/src/test/resources/assistant/message_response.json": [ + { + "hashed_secret": "d506bd5213c46bd49e16c634754ad70113408252", + "is_secret": false, + "is_verified": false, + "line_number": 165, + "type": "Secret Keyword", + "verified_result": null + } + ], + "discovery/src/main/java/com/ibm/watson/discovery/v1/model/CredentialDetails.java": [ + { + "hashed_secret": "e8fc807ce6fbcda13f91c5b64850173873de0cdc", + "is_secret": false, + "is_verified": false, + "line_number": 42, + "type": "Secret Keyword", + "verified_result": null + }, + { + "hashed_secret": "fdee05598fdd57ff8e9ae29e92c25a04f2c52fa6", + "is_secret": false, + "is_verified": false, + "line_number": 44, + "type": "Secret Keyword", + "verified_result": null + } + ] + }, + "version": "0.13.1+ibm.56.dss", + "word_list": { + "file": null, + "hash": null + } +} diff --git a/.travis.yml b/.travis.yml index 59c4789a68b..02a7a19eae2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,68 +1,78 @@ +--- language: java -sudo: required -dist: precise +dist: xenial +os: linux + jdk: - - oraclejdk7 - - oraclejdk8 + - openjdk8 + +notifications: + email: true branches: except: - - gh-pages - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ + - gh-pages cache: directories: - - $HOME/.m2 - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ + - "$HOME/.m2" + env: global: - - secure: S2KIWOJX35j1FczyV7JRFrFpTftb8Hmkf6C50bJh8E03IbPu7tnX2znPKBbRWcIQndO6qd5dL7+BqtXabByOzd5Slj5/NBdXPcGffsO7B0cpFQS8ngpIMAGReCXQ12PbOiO8CIk2f/20lU3L0kqcP1TaPyZYIlSwkUg98ls8p90= - - secure: eLv41LVZoRCqQehOM29RLodZ6NZhrIdLWklAkMdLGlFDEiVY5f0shaPLffpUiuv/3pg+CuQk9ffBc72m8lwTsimex9unC/WVsqQJhqQEWJEaPGL0UamV/HqHMeBQEpKiCcKHaBRHFGk7QQJVtiXvVvlbwk7Jks5giUR7+s/Q6iI= - - secure: l0dde5NSGedD6fny5aMr1ll90FYVd7IKDsZ0Kd1GWnB+iDd3rjDBwz5q6NUwN2LTqw3jWFqmqdEnGUGO3Er0rdfdtPh3K194sTK3XuCZz8GEjFvYAEDRQ59oyK8fhw60c86cWppBQ4gluLKLstm12DLkARTUvJiIsTQTnuc2YGg= - -install: true - -before_install: - - sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml + - MVN_ARGS="--settings build/.travis.settings.xml" -script: - - '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_b248e84a4806_key -iv $encrypted_b248e84a4806_iv -in config.properties.enc -out core/src/test/resources/config.properties -d || true' - - ./gradlew install -x check - - ./gradlew checkstyleMain - - ./gradlew checkstyleTest - - ./gradlew codeCoverageReport --continue - - ./gradlew docs > /dev/null # build the javadoc +stages: + - name: Build and test + - name: Semantic-Release + if: branch = master AND type = push AND fork = false + - name: Publish-Release + if: tag IS present -after_success: - - bash <(curl -s https://codecov.io/bash) +jobs: + include: + - stage: Build and test + jdk: openjdk8 + language: java + install: + - curl -s https://codecov.io/bash > $HOME/codecov-bash.sh && chmod +x $HOME/codecov-bash.sh + script: + - build/setMavenVersion.sh + - mvn verify -fae -DskipITs $MVN_ARGS + after_success: + - build/publishCodeCoverage.sh -deploy: - - provider: script - script: .utility/push-javadoc-to-gh-pages.sh - skip_cleanup: true - on: - repo: watson-developer-cloud/java-sdk - jdk: oraclejdk7 - tags: true + - stage: Semantic-Release + install: + - sudo apt-get install python + - nvm install 12 + - npm install -g npm@6.x + - pip install --user bump2version + - npm install @semantic-release/changelog + - npm install @semantic-release/exec + - npm install @semantic-release/git + - npm install @semantic-release/github + script: + - npx semantic-release + after_success: + - echo "Semantic release has successfully created a new tagged-release" - - provider: script - script: .utility/deploy.sh - skip_cleanup: true - on: - repo: watson-developer-cloud/java-sdk - jdk: oraclejdk7 + - stage: Publish-Release + jdk: openjdk8 + name: Publish-Javadoc + install: true + script: + - build/setMavenVersion.sh + - mvn clean javadoc:aggregate $MVN_ARGS + - build/publishJavadoc.sh + after_success: + - echo "Javadocs successfully published to gh-pages!" - - provider: releases - api_key: ${GITHUB_TOKEN_RELEASES} - file: java-sdk/build/libs/${TRAVIS_BRANCH}-jar-with-dependencies.jar - skip_cleanup: true - on: - repo: watson-developer-cloud/java-sdk - jdk: oraclejdk7 - tags: true -notifications: - email: true + - jdk: openjdk8 + name: Publish-To-Maven-Central + install: true + script: + - build/setupSigning.sh + - build/setMavenVersion.sh + - mvn deploy $MVN_ARGS -DskipTests -P central + after_success: + - echo "Maven artifacts successfully published to Maven Central!" \ No newline at end of file diff --git a/.utility/cd/secring.gpg.enc b/.utility/cd/secring.gpg.enc deleted file mode 100644 index ab53a4058a5..00000000000 Binary files a/.utility/cd/secring.gpg.enc and /dev/null differ diff --git a/.utility/deploy.sh b/.utility/deploy.sh deleted file mode 100755 index 336a80f9b42..00000000000 --- a/.utility/deploy.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then - openssl aes-256-cbc -K $encrypted_2a8b0f951653_key -iv $encrypted_2a8b0f951653_iv -in .utility/cd/secring.gpg.enc -out .utility/cd/secring.gpg -d - ./gradlew uploadArchives -Psigning.keyId=$SIGNING_KEY -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=$KEYRING_PATH -PossrhUsername=$OSSRH_JIRA_USERNAME -PossrhPassword=$OSSRH_JIRA_PASSWORD -fi diff --git a/.utility/generate-api-diff.sh b/.utility/generate-api-diff.sh deleted file mode 100755 index ba0ec23c97b..00000000000 --- a/.utility/generate-api-diff.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env bash -# Author: Hanbin Cho (mraerok@gmail.com) -# Description: This script 1) downloads the latest java-sdk jar published in Maven Repo 2) builds the jar of current java-sdk version, then 3) generate an API diff report of the two versions. -# Assumptions -# 1. This script is placed in .utility folder of the java-sdk. -# 2. Version format is [0-9].[0-9].[0-9] - -# Step 1: Download the latest release of java-sdk published in Maven Repository. -mvn dependency:get \ - -DgroupId=com.ibm.watson.developer_cloud \ - -DartifactId=java-sdk \ - -Dversion=LATEST \ - -Dpackaging=jar \ - -Dclassifier=jar-with-dependencies \ - -Dtransitive=false - -# Step 2: Construct the filepath to the latest release of java-sdk. -LOCAL_MAVEN_REPO_PATH="${HOME}/.m2/repository" -RELEASE_JAR_BASEPATH="${LOCAL_MAVEN_REPO_PATH}/com/ibm/watson/developer_cloud/java-sdk" -pushd $RELEASE_JAR_BASEPATH -LATEST_RELEASE_VERSION=`ls | grep -d read "[0-9]\.[0-9]\.[0-9]" | sort | tail -n 1` -LATEST_RELEASE_JAR_FILENAME="java-sdk-${LATEST_RELEASE_VERSION}-jar-with-dependencies.jar" -LATEST_RELEASE_JAR_PATH="${RELEASE_JAR_BASEPATH}/${LATEST_RELEASE_VERSION}/${LATEST_RELEASE_JAR_FILENAME}" - -# Step 3: Validate the filepath to the latest release of java-sdk. -if [ ! -f $LATEST_RELEASE_JAR_PATH ]; then - echo "apidiff.sh: Latest release jar was not at its expected location at: $LATEST_RELEASE_JAR_PATH" - popd - exit 1 -fi -popd - -# Step 4: Generate a stand-alone jar of the current version of java-sdk. -./gradlew shadowJar - -# Step 5: Construct the filepath to the current version of java-sdk. -CURRENT_VERSION=`cat ../gradle.properties | grep "version=[0-9]\.[0-9]\.[0-9]" | cut -d '=' -f 2` -CURRENT_JAR_FILENAME="java-sdk-${CURRENT_VERSION}-jar-with-dependencies.jar" -CURRENT_JAR_BASEPATH="java-sdk/build/libs" -CURRENT_JAR_PATH="${CURRENT_JAR_BASEPATH}/${CURRENT_JAR_FILENAME}" - -# Step 6: Validate the filepath to the current version of java-sdk. -if [ ! -f $CURRENT_JAR_PATH ]; then - echo "apidiff.sh: Current jar was not at its expected location at: $CURRENT_JAR_PATH" - exit 1 -fi - -# Step 7: Produce an API diff between the latest release and the current version using japicmp module. -./gradlew japicmp -PoldJarPath="${LATEST_RELEASE_JAR_PATH}" -PnewJarPath="${CURRENT_JAR_PATH}" -PoldJarVersion="${LATEST_RELEASE_VERSION}" -PnewJarVersion="${CURRENT_VERSION}" diff --git a/.utility/generate_apidiff_index_html.sh b/.utility/generate_apidiff_index_html.sh deleted file mode 100755 index 3d063655604..00000000000 --- a/.utility/generate_apidiff_index_html.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -# based on https://odoepner.wordpress.com/2012/02/17/shell-script-to-generate-simple-index-html/ - -echo ' - -
- - - -Info - | Documentation - | API Diff - | GitHub - | Maven -
-API Diff by version
-Info - | Documentation - | API Diff - | GitHub - | Maven -
- -Javadoc by branch/tag:
-Logan Patino 💻 🎨 🐛 |
+ Ajiemar Santiago 💻 🎨 🐛 |
+ German Attanasio 💻 🎨 📖 ⚠️ |
+ Kevin Kowalski 💻 🎨 🐛 📖 ⚠️ 💬️ |
+ Jeff Arn 💻 🎨 🐛 📖 ⚠️ 💬️ |
+ Angelo Paparazzi 💻 🎨 🐛 📖 ⚠️ 💬️ 🥷🏼 |
+
- To then update all version numbers, simply run:
+- After doing this with all of the necessary packages, you can verify that things worked by checking the available versions on [Maven Central](https://search.maven.org/search?q=com.ibm.watson). This could take up to an hour.
- ```bash
- bumpversion major|minor|patch
- ```
+### Unsuccessful Bintray deployment
- 1. Perform a release deployment to OSSRH (Staging) with:
+This case is much more unlikely, since integration tests don't run on `master` and builds are very unlikely to be passing in a PR but fail once it's merged. Nevertheless, if this does happen and files aren't deployed to Bintray, you'll need to follow some steps to do this manually:
- ```bash
- `gradle release`
- ```
+- 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.
+- For each package in the SDK, if the new version isn't present, you can add it by navigating to the package and adding it manually:
- You will have to answer prompts for versions and tags. That will tag and commit a new version into your repository automatically.
+
-[bumpversion]: https://pypi.python.org/pypi/bumpversion
+- To add the files, make sure to first generate all of the necessary artifacts locally. Check out the new release tag and generate them with the following commands (from the SDK repo):
+ ```
+ git checkout {release tag}
+ ./gradlew shadowJar
+ ```
+- In the new version of the package on Bintray, add the files with the "Upload Files" button. Follow the file structure of previous releases to ensure everything works properly. The files to add should be in the `build/libs` folder of each local package in the SDK.
-### Manually releasing
+
-The above steps should work, but we've run into situations where the archive uploading through CI has failed because IP changes caused multiple staging repositories to be created in Sonatype, each with different pieces of the full set of artifacts. If this happens, the repositories won't be able to be closed and released on the Sonatype website.
-
-Uploading the archives locally with the following command solves this problem:
-
-```bash
-./gradlew uploadArchives -Psigning.keyId=The Assistant v1 API provides authoring methods your application can use to create or update a + * workspace. + * + *
API Version: 1.0 See: https://cloud.ibm.com/docs/assistant + */ +public class Assistant extends BaseService { + + /** Default service name used when configuring the `Assistant` client. */ + public static final String DEFAULT_SERVICE_NAME = "assistant"; + + /** Default service endpoint URL. */ + public static final String DEFAULT_SERVICE_URL = + "https://api.us-south.assistant.watson.cloud.ibm.com"; + + private String version; + + /** + * Constructs an instance of the `Assistant` client. The default service name is used to configure + * the client instance. + * + * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD + * format. The current version is `2021-11-27`. + */ + public Assistant(String version) { + this( + version, + DEFAULT_SERVICE_NAME, + ConfigBasedAuthenticatorFactory.getAuthenticator(DEFAULT_SERVICE_NAME)); + } + + /** + * Constructs an instance of the `Assistant` client. The default service name and specified + * authenticator are used to configure the client instance. + * + * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD + * format. The current version is `2021-11-27`. + * @param authenticator the {@link Authenticator} instance to be configured for this client + */ + public Assistant(String version, Authenticator authenticator) { + this(version, DEFAULT_SERVICE_NAME, authenticator); + } + + /** + * Constructs an instance of the `Assistant` client. The specified service name is used to + * configure the client instance. + * + * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD + * format. The current version is `2021-11-27`. + * @param serviceName the service name to be used when configuring the client instance + */ + public Assistant(String version, String serviceName) { + this(version, serviceName, ConfigBasedAuthenticatorFactory.getAuthenticator(serviceName)); + } + + /** + * Constructs an instance of the `Assistant` client. The specified service name and authenticator + * are used to configure the client instance. + * + * @param version Release date of the API version you want to use. Specify dates in YYYY-MM-DD + * format. The current version is `2021-11-27`. + * @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 Assistant(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 API version you want to use. Specify dates in YYYY-MM-DD format. The + * current version is `2021-11-27`. + * + * @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; + } + + /** + * Update dialog node. + * + *
Update an existing dialog node with new or modified data. + * + *
If you want to update multiple dialog nodes with a single API call, consider using the
+ * **[Update workspace](#update-workspace)** method instead.
+ *
+ * @param UpdateDialogNodeNullableOptions the {@link UpdateDialogNodeNullableOptions} containing
+ * the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link DialogNode}
+ */
+ public ServiceCall Send user input to a workspace and receive a response.
+ *
+ * **Important:** This method has been superseded by the new v2 runtime API. The v2 API offers
+ * significant advantages, including ease of deployment, automatic state management, versioning,
+ * and search capabilities. For more information, see the
+ * [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-api-overview).
+ *
+ * @param messageOptions the {@link MessageOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link MessageResponse}
+ */
+ public ServiceCall Send multiple user inputs to a workspace in a single request and receive information about
+ * the intents and entities recognized in each input. This method is useful for testing and
+ * comparing the performance of different workspaces.
+ *
+ * This method is available only with Enterprise with Data Isolation plans.
+ *
+ * @param bulkClassifyOptions the {@link BulkClassifyOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link BulkClassifyResponse}
+ */
+ public ServiceCall List the workspaces associated with a Watson Assistant service instance.
+ *
+ * @param listWorkspacesOptions the {@link ListWorkspacesOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a result of type {@link WorkspaceCollection}
+ */
+ public ServiceCall List the workspaces associated with a Watson Assistant service instance.
+ *
+ * @return a {@link ServiceCall} with a result of type {@link WorkspaceCollection}
+ */
+ public ServiceCall Create a workspace based on component objects. You must provide workspace components
+ * defining the content of the new workspace.
+ *
+ * **Note:** The new workspace data cannot be larger than 1.5 MB. For larger requests, use the
+ * **Create workspace asynchronously** method.
+ *
+ * @param createWorkspaceOptions the {@link CreateWorkspaceOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Create a workspace based on component objects. You must provide workspace components
+ * defining the content of the new workspace.
+ *
+ * **Note:** The new workspace data cannot be larger than 1.5 MB. For larger requests, use the
+ * **Create workspace asynchronously** method.
+ *
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Get information about a workspace, optionally including all workspace content.
+ *
+ * @param getWorkspaceOptions the {@link GetWorkspaceOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Update an existing workspace with new or modified data. You must provide component objects
+ * defining the content of the updated workspace.
+ *
+ * **Note:** The new workspace data cannot be larger than 1.5 MB. For larger requests, use the
+ * **Update workspace asynchronously** method.
+ *
+ * @param updateWorkspaceOptions the {@link UpdateWorkspaceOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Delete a workspace from the service instance.
+ *
+ * @param deleteWorkspaceOptions the {@link DeleteWorkspaceOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a void result
+ */
+ public ServiceCall Create a workspace asynchronously based on component objects. You must provide workspace
+ * components defining the content of the new workspace.
+ *
+ * A successful call to this method only initiates asynchronous creation of the workspace. The
+ * new workspace is not available until processing completes. To check the status of the
+ * asynchronous operation, use the **Get information about a workspace** method.
+ *
+ * @param createWorkspaceAsyncOptions the {@link CreateWorkspaceAsyncOptions} containing the
+ * options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Create a workspace asynchronously based on component objects. You must provide workspace
+ * components defining the content of the new workspace.
+ *
+ * A successful call to this method only initiates asynchronous creation of the workspace. The
+ * new workspace is not available until processing completes. To check the status of the
+ * asynchronous operation, use the **Get information about a workspace** method.
+ *
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Update an existing workspace asynchronously with new or modified data. You must provide
+ * component objects defining the content of the updated workspace.
+ *
+ * A successful call to this method only initiates an asynchronous update of the workspace. The
+ * updated workspace is not available until processing completes. To check the status of the
+ * asynchronous operation, use the **Get information about a workspace** method.
+ *
+ * @param updateWorkspaceAsyncOptions the {@link UpdateWorkspaceAsyncOptions} containing the
+ * options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall Export the entire workspace asynchronously, including all workspace content.
+ *
+ * A successful call to this method only initiates an asynchronous export. The exported JSON
+ * data is not available until processing completes. After the initial request is submitted, you
+ * can continue to poll by calling the same request again and checking the value of the **status**
+ * property. When processing has completed, the request returns the exported JSON data. Remember
+ * that the usual rate limits apply.
+ *
+ * @param exportWorkspaceAsyncOptions the {@link ExportWorkspaceAsyncOptions} containing the
+ * options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Workspace}
+ */
+ public ServiceCall List the intents for a workspace.
+ *
+ * @param listIntentsOptions the {@link ListIntentsOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link IntentCollection}
+ */
+ public ServiceCall Create a new intent.
+ *
+ * If you want to create multiple intents with a single API call, consider using the **[Update
+ * workspace](#update-workspace)** method instead.
+ *
+ * @param createIntentOptions the {@link CreateIntentOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Intent}
+ */
+ public ServiceCall Get information about an intent, optionally including all intent content.
+ *
+ * @param getIntentOptions the {@link GetIntentOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Intent}
+ */
+ public ServiceCall Update an existing intent with new or modified data. You must provide component objects
+ * defining the content of the updated intent.
+ *
+ * If you want to update multiple intents with a single API call, consider using the **[Update
+ * workspace](#update-workspace)** method instead.
+ *
+ * @param updateIntentOptions the {@link UpdateIntentOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Intent}
+ */
+ public ServiceCall Delete an intent from a workspace.
+ *
+ * @param deleteIntentOptions the {@link DeleteIntentOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a void result
+ */
+ public ServiceCall List the user input examples for an intent, optionally including contextual entity mentions.
+ *
+ * @param listExamplesOptions the {@link ListExamplesOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link ExampleCollection}
+ */
+ public ServiceCall Add a new user input example to an intent.
+ *
+ * If you want to add multiple examples with a single API call, consider using the **[Update
+ * intent](#update-intent)** method instead.
+ *
+ * @param createExampleOptions the {@link CreateExampleOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a result of type {@link Example}
+ */
+ public ServiceCall Get information about a user input example.
+ *
+ * @param getExampleOptions the {@link GetExampleOptions} containing the options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Example}
+ */
+ public ServiceCall Update the text of a user input example.
+ *
+ * If you want to update multiple examples with a single API call, consider using the **[Update
+ * intent](#update-intent)** method instead.
+ *
+ * @param updateExampleOptions the {@link UpdateExampleOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a result of type {@link Example}
+ */
+ public ServiceCall Delete a user input example from an intent.
+ *
+ * @param deleteExampleOptions the {@link DeleteExampleOptions} containing the options for the
+ * call
+ * @return a {@link ServiceCall} with a void result
+ */
+ public ServiceCall List the counterexamples for a workspace. Counterexamples are examples that have been marked
+ * as irrelevant input.
+ *
+ * @param listCounterexamplesOptions the {@link ListCounterexamplesOptions} containing the options
+ * for the call
+ * @return a {@link ServiceCall} with a result of type {@link CounterexampleCollection}
+ */
+ public ServiceCall Add a new counterexample to a workspace. Counterexamples are examples that have been marked
+ * as irrelevant input.
+ *
+ * If you want to add multiple counterexamples with a single API call, consider using the
+ * **[Update workspace](#update-workspace)** method instead.
+ *
+ * @param createCounterexampleOptions the {@link CreateCounterexampleOptions} containing the
+ * options for the call
+ * @return a {@link ServiceCall} with a result of type {@link Counterexample}
+ */
+ public ServiceCall