Update code to use new client

This commit is contained in:
Jannis Mattheis
2019-02-20 19:00:56 +01:00
parent 1280814425
commit 91ac373642
3 changed files with 7 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ import com.github.gotify.api.Callback;
import com.github.gotify.api.CertUtils;
import com.github.gotify.api.ClientFactory;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.api.TokenApi;
import com.github.gotify.client.api.ClientApi;
import com.github.gotify.client.api.UserApi;
import com.github.gotify.client.model.Client;
import com.github.gotify.client.model.VersionInfo;
@@ -273,7 +273,7 @@ public class LoginActivity extends AppCompatActivity {
public DialogInterface.OnClickListener doCreateClient(ApiClient client, EditText nameProvider) {
return (a, b) -> {
Client newClient = new Client().name(nameProvider.getText().toString());
client.createService(TokenApi.class)
client.createService(ClientApi.class)
.createClient(newClient)
.enqueue(callInUI(this, this::onCreatedClient, this::onFailedToCreateClient));
};

View File

@@ -32,8 +32,8 @@ import com.github.gotify.api.ApiException;
import com.github.gotify.api.CertUtils;
import com.github.gotify.api.ClientFactory;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.api.ClientApi;
import com.github.gotify.client.api.MessageApi;
import com.github.gotify.client.api.TokenApi;
import com.github.gotify.client.model.Application;
import com.github.gotify.client.model.Client;
import com.github.gotify.client.model.Message;
@@ -427,10 +427,10 @@ public class MessagesActivity extends AppCompatActivity
@Override
protected Void doInBackground(Void... ignore) {
TokenApi api =
ClientApi api =
ClientFactory.clientToken(
settings.url(), settings.sslSettings(), settings.token())
.createService(TokenApi.class);
.createService(ClientApi.class);
stopService(new Intent(MessagesActivity.this, WebSocketService.class));
try {
List<Client> clients = Api.execute(api.getClients());

View File

@@ -5,7 +5,7 @@ import com.github.gotify.Utils;
import com.github.gotify.api.ApiException;
import com.github.gotify.api.Callback;
import com.github.gotify.client.ApiClient;
import com.github.gotify.client.api.TokenApi;
import com.github.gotify.client.api.ApplicationApi;
import com.github.gotify.client.model.Application;
import java.util.Collections;
import java.util.List;
@@ -28,7 +28,7 @@ public class ApplicationHolder {
}
public void request() {
client.createService(TokenApi.class)
client.createService(ApplicationApi.class)
.getApps()
.enqueue(Callback.callInUI(activity, this::onReceiveApps, this::onFailedApps));
}