You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ gradle codeCoverageReport # run tests and generate the code coverage report (bui
18
18
19
19
If you want to contribute to the repository, here's a quick guide:
20
20
1. Fork the repository
21
-
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).
21
+
1.Edit the [`config.properties`](../common/src/test/resources/config.properties) file to add your service credentials to the appropriate fields.
22
22
2. develop and test your code changes, gradle: `gradle test`.
23
23
* Run `checkstyle`: `gradle checkstyle`. 🏁
24
24
* 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.
@@ -118,8 +118,6 @@ Watson services are migrating to token-based Identity and Access Management (IAM
118
118
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
119
119
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
120
120
121
-
**Note:** Previously, it was possible to authenticate using a token in a header called `X-Watson-Authorization-Token`. This method is deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. See [here](#iam) for details.
122
-
123
121
### Getting credentials
124
122
125
123
To find out which authentication to use, view the service credentials. You find the service credentials for authentication the same way for all Watson services:
No matter which method you use to make an API request (`execute()`, `enqueue()`, or `reactiveRequest()`), you'll get back an object of form `Response<T>`, where `T` is the model representing the specific response model.
235
+
236
+
Here's an example of how to parse that response and get additional information beyond the response model:
237
+
238
+
```java
239
+
// listing our workspaces with an instance of the Assistant v1 service
The HTTP client can be configured by using the `configureClient()` method on your service object, passing in an `HttpConfigOptions` object. Currently, the following options are supported:
However, if you need to perform these calls in the background, there are two other main methods to do this asynchronously: `enqueue()` and `reactiveRequest()`.
281
+
However, if you need to perform these calls in the background, there are two other methods to do this asynchronously: `enqueue()` and `reactiveRequest()`.
265
282
266
283
#### `enqueue()`
267
284
@@ -270,7 +287,7 @@ This method allows you to set a callback for the service response through the us
If you're a fan of the [RxJava](https://github.com/ReactiveX/RxJava) library, this method lets you leverage that to allow for "reactive" programming. The method will return a `Single<T>` which you can manipulate how you please. Example:
Custom headers can be passed with any request. To do so, add the header to the `ServiceCall` object before executing the request. For example, this is what it looks like to send the header `Custom-Header` along with a call to the Watson Assistant service:
The basic `execute()`, `enqueue()`, and `rx()` methods make HTTP requests to your Watson service and return models based on the requested endpoint. If you would like access to some HTTP response information along with the response model, you can use the more detailed versions of those three methods: `executeWithDetails()`, `enqueueWithDetails()`, and `rxWithDetails()`. To capture the responses, use the new `Response<T>` class, with `T` being the expected response model.
331
-
332
-
Here is an example of calling the Watson Assistant `listWorkspaces()` method and parsing its response model as well as the response headers:
0 commit comments