Skip to content

Commit 929fb8b

Browse files
authored
Merge branch 'master' into visrec-deprecation
2 parents 75f01d5 + c61fb84 commit 929fb8b

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ For example, here is how to connect to a Watson Assistant instance that is hoste
244244
let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
245245
let assistant = Assistant(version: "{version}", authenticator: authenticator)
246246

247-
assistant.serviceURL = "https://gateway-fra.watsonplatform.net/conversation/api"
247+
assistant.serviceURL = "https://api.eu-de.assistant.watson.cloud.ibm.com"
248248
```
249249

250250
## Disable SSL certificate verification

Source/SpeechToTextV1/WebSockets/SpeechToTextSession.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import IBMSwiftSDKCore
3434
public class SpeechToTextSession {
3535

3636
/// The URL that shall be used to stream audio for transcription.
37-
public var websocketsURL = "wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize" {
37+
public var websocketsURL = "https://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize" {
3838
didSet {
3939
// serviceURL and tokenURL are both derivative of websocketsURL
4040
if websocketsURL.last == "/" {
@@ -48,10 +48,10 @@ public class SpeechToTextSession {
4848
}
4949

5050
/// The base URL of the Speech to Text service.
51-
internal var serviceURL = "https://stream.watsonplatform.net/speech-to-text/api"
51+
internal var serviceURL = "https://api.us-south.speech-to-text.watson.cloud.ibm.com"
5252

5353
/// The URL that shall be used to obtain a token.
54-
internal var tokenURL = "https://stream.watsonplatform.net/authorization/api/v1/token"
54+
internal var tokenURL = "https://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/token"
5555

5656
/// The default HTTP headers for all requests to the service.
5757
public var defaultHeaders = [String: String]()

Tests/NaturalLanguageClassifierV1Tests/createClassifier.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ curl -X POST -u "${USERNAME}":"${PASSWORD}" \
77
-H 'Accept: application/json' -H 'X-Watson-Learning-Opt-Out: true' -H 'X-Watson-Test: true' \
88
-F training_metadata="{\"language\":\"en\",\"name\":\"swift-sdk-test-classifier - DO NOT DELETE\"}" \
99
-F training_data=@weather_data_train.csv \
10-
"https://gateway.watsonplatform.net/natural-language-classifier/api/v1/classifiers"
10+
"https://api.us-south.natural-language-classifier.watson.cloud.ibm.com/v1/classifiers"

Tests/SpeechToTextV1Tests/SpeechToTextUnitTests.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ class SpeechToTextUnitTests: XCTestCase {
3535
let speechToTextSession = SpeechToTextSession(authenticator: defaultTestAuthenticator)
3636

3737
// Default URLs value
38-
XCTAssertEqual(speechToTextSession.websocketsURL, "wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize")
39-
XCTAssertEqual(speechToTextSession.serviceURL, "https://stream.watsonplatform.net/speech-to-text/api")
38+
XCTAssertEqual(speechToTextSession.websocketsURL, "wss://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize")
39+
XCTAssertEqual(speechToTextSession.serviceURL, "https://api.us-south.speech-to-text.watson.cloud.ibm.com")
4040

4141
// Set websockets URL and verify serviceURL
42-
speechToTextSession.websocketsURL = "wss://gateway-syd.watsonplatform.net/speech-to-text/api/v1/recognize"
43-
XCTAssertEqual(speechToTextSession.serviceURL, "https://gateway-syd.watsonplatform.net/speech-to-text/api")
42+
speechToTextSession.websocketsURL = "wss://api.au-syd.speech-to-text.watson.cloud.ibm.com/v1/recognize"
43+
XCTAssertEqual(speechToTextSession.serviceURL, "https://api.au-syd.speech-to-text.watson.cloud.ibm.com")
4444

4545
// Trailing forward slash
46-
speechToTextSession.websocketsURL = "wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize/"
47-
XCTAssertEqual(speechToTextSession.serviceURL, "https://stream.watsonplatform.net/speech-to-text/api")
46+
speechToTextSession.websocketsURL = "wss://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize/"
47+
XCTAssertEqual(speechToTextSession.serviceURL, "api.us-south.speech-to-text.watson.cloud.ibm.com")
4848

4949
// http instead of https
50-
speechToTextSession.websocketsURL = "ws://stream.watsonplatform.net/speech-to-text/api/v1/recognize"
51-
XCTAssertEqual(speechToTextSession.serviceURL, "http://stream.watsonplatform.net/speech-to-text/api")
50+
speechToTextSession.websocketsURL = "ws://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize"
51+
XCTAssertEqual(speechToTextSession.serviceURL, "api.us-south.speech-to-text.watson.cloud.ibm.com")
5252

5353
// Different base URL
5454
speechToTextSession.websocketsURL = "wss://example.com/speech-to-text/api/v1/recognize/v1/recognize"
@@ -60,16 +60,16 @@ class SpeechToTextUnitTests: XCTestCase {
6060
let speechToTextSession = SpeechToTextSession(authenticator: defaultTestAuthenticator)
6161

6262
// Default URLs value
63-
XCTAssertEqual(speechToTextSession.websocketsURL, "wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize")
64-
XCTAssertEqual(speechToTextSession.tokenURL, "https://stream.watsonplatform.net/authorization/api/v1/token")
63+
XCTAssertEqual(speechToTextSession.websocketsURL, "wss://api.us-south.speech-to-text.watson.cloud.ibm.com/recognize")
64+
XCTAssertEqual(speechToTextSession.tokenURL, "https://api.us-south.speech-to-text.watson.cloud.ibm.com/authorization/api/v1/token")
6565

6666
// Set websockets URL and verify tokenURL
67-
speechToTextSession.websocketsURL = "wss://gateway-syd.watsonplatform.net/speech-to-text/api/v1/recognize"
68-
XCTAssertEqual(speechToTextSession.tokenURL, "https://gateway-syd.watsonplatform.net/authorization/api/v1/token")
67+
speechToTextSession.websocketsURL = "wss://api.au-syd.speech-to-text.watson.cloud.ibm.com/v1/recognize"
68+
XCTAssertEqual(speechToTextSession.tokenURL, "https://api.au-syd.speech-to-text.watson.cloud.ibm.com/authorization/api/v1/token")
6969

7070
// http instead of https
71-
speechToTextSession.websocketsURL = "ws://stream.watsonplatform.net/speech-to-text/api/v1/recognize"
72-
XCTAssertEqual(speechToTextSession.tokenURL, "http://stream.watsonplatform.net/authorization/api/v1/token")
71+
speechToTextSession.websocketsURL = "ws://api.us-south.speech-to-text.watson.cloud.ibm.com/v1/recognize"
72+
XCTAssertEqual(speechToTextSession.tokenURL, "http://api.us-south.speech-to-text.watson.cloud.ibm.com/authorization/api/v1/token")
7373

7474
// Different base URL
7575
speechToTextSession.websocketsURL = "wss://example.com/speech-to-text/api/v1/recognize/v1/recognize"

Tests/VisualRecognitionV3Tests/VisualRecognitionUnitTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ class VisualRecognitionUnitTests: XCTestCase {
347347
setenv("IBM_CREDENTIALS_FILE", "Source/SupportingFiles/ibm-credentials.env", 1)
348348
let visualRecognition: VisualRecognition? = try? VisualRecognition(version: versionDate)
349349
XCTAssertNotNil(visualRecognition)
350-
XCTAssertEqual("https://gateway.watsonplatform.net/visual-recognition/api", visualRecognition?.serviceURL)
350+
XCTAssertEqual("https://api.us-south.visual-recognition.watson.cloud.ibm.com", visualRecognition?.serviceURL)
351351
}
352352
#endif
353353

Tests/VisualRecognitionV3Tests/createClassifier.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ curl -X POST \
77
-F "car_positive_examples=@Resources/cars.zip" \
88
-F "negative_examples=@Resources/trucks.zip" \
99
-F "name=CarsVsTrucks - do not delete" \
10-
"https://gateway-a.watsonplatform.net/visual-recognition/api/v3/classifiers?api_key=${API_KEY}&version=${VERSION}"
10+
"https://api.us-south.visual-recognition.watson.cloud.ibm.com/v3/classifiers?api_key=${API_KEY}&version=${VERSION}"
1111

0 commit comments

Comments
 (0)