Android Get URL Application Latest Upgrade Information
This method retrieves the latest upgrade strategy for URL applications.
Request Parameter List
| Parameter Name | Type | Description |
|---|---|---|
| request | UrlUpgradeRequest | Set specific interface request parameters, see URL Application Get Upgrade Strategy |
Return Value List
| Return Value Name | Type | Description |
|---|---|---|
| result | UrlUpgradeResponse | Interface return value, specific interface return parameters, see URL Application Get Upgrade Strategy |
Example Code
You can use the following code to obtain the latest upgrade strategy.
Get URL Application Latest Upgrade Information - Synchronous Call
java
package com.toolsetlink.upgradelink.api;
import com.toolsetlink.upgradelink.api.models.*;
import org.junit.*;
import java.io.IOException;
import java.util.concurrent.*;
public class SimpleClientTest {
private Client client;
@Before
public void setUp() {
Config config = new Config();
config.accessKey = "mui2W50H1j-OC4xD6PgQag";
config.secretKey = "PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc";
client = new Client(config);
}
@Test
public void getUrlUpgrade_shouldCallCallbackOnSuccess() throws Exception {
UrlUpgradeRequest request = new UrlUpgradeRequest(
"uJ47NPeT7qjLa1gL3sVHqw",
1,
0,
"",
""
);
try {
UrlUpgradeResponse response = client.getUrlUpgrade(request);
System.out.println("getUrlUpgrade request response: " + response.toString());
} catch (Exception e) {
// Print exception stack trace
e.printStackTrace();
// Let the test fail and give an error message
Assert.fail("getUrlUpgrade request failed: " + e.getClass().getSimpleName() + ": " + e.getMessage());
}
}
}Get URL Application Latest Upgrade Information - Asynchronous Call
java
package com.toolsetlink.upgradelink.api;
import com.toolsetlink.upgradelink.api.models.*;
import org.junit.*;
import java.io.IOException;
import java.util.concurrent.*;
public class SimpleClientTest {
private Client client;
@Before
public void setUp() {
Config config = new Config();
config.accessKey = "mui2W50H1j-OC4xD6PgQag";
config.secretKey = "PEbdHFGC0uO_Pch7XWBQTMsFRxKPQAM2565eP8LJ3gc";
client = new Client(config);
}
@Test
public void getUrlUpgradeAsync_shouldCallCallbackOnSuccess() throws Exception {
UrlUpgradeRequest request = new UrlUpgradeRequest(
"uJ47NPeT7qjLa1gL3sVHqw",
1,
0,
"",
""
);
CountDownLatch latch = new CountDownLatch(1);
Client.Callback<UrlUpgradeResponse> callback = new Client.Callback<>() {
@Override
public void onSuccess(UrlUpgradeResponse response) {
System.out.println("getUrlUpgrade request response: " + response.toString());
latch.countDown();
}
@Override
public void onFailure(Throwable t) {
t.printStackTrace();
Assert.fail("getUrlUpgrade request failed: " + t.getClass().getSimpleName() + ": " + t.getMessage());
latch.countDown();
}
};
client.getUrlUpgradeAsync(request, callback);
Assert.assertTrue("Test timed out", latch.await(15, TimeUnit.SECONDS));
}
}