use of com.voipgrid.vialer.api.Api in project vialer-android by VoIPGRID.
the class SetupActivity method resetPassword.
private void resetPassword(String email) {
Api api = ServiceGenerator.createService(this, Api.class, getString(R.string.api_url));
Call<Object> call = api.resetPassword(new PasswordResetParams(email));
call.enqueue(this);
}
use of com.voipgrid.vialer.api.Api in project vialer-android by VoIPGRID.
the class WebActivity method autoLoginToken.
/**
* Request an autologin token
*/
private void autoLoginToken() {
mProgressBar.setVisibility(View.VISIBLE);
Api api = ServiceGenerator.createService(this, Api.class, getString(R.string.api_url), getIntent().getStringExtra(USERNAME), getIntent().getStringExtra(PASSWORD));
Call<AutoLoginToken> call = api.autoLoginToken();
call.enqueue(this);
}
use of com.voipgrid.vialer.api.Api in project vialer-android by VoIPGRID.
the class AccountActivity method save.
private void save() {
findViewById(R.id.container).setFocusableInTouchMode(true);
String number = ((EditText) findViewById(R.id.account_mobile_number_edit_text)).getText().toString();
number = PhoneNumberUtils.formatMobileNumber(number);
Api api = ServiceGenerator.createService(this, Api.class, getString(R.string.api_url), getEmail(), getPassword());
Call<MobileNumber> call = api.mobileNumber(new MobileNumber(number));
call.enqueue(this);
mSystemUser.setMobileNumber(number);
populate();
}
use of com.voipgrid.vialer.api.Api in project vialer-android by VoIPGRID.
the class CallRecordFragment method loadCallRecordsFromApi.
private void loadCallRecordsFromApi() {
mHaveNetworkRecords = false;
AccountHelper accountHelper = new AccountHelper(getActivity());
Api api = ServiceGenerator.createService(getContext(), Api.class, getString(R.string.api_url), accountHelper.getEmail(), accountHelper.getPassword());
Call<VoipGridResponse<CallRecord>> call = api.getRecentCalls(50, 0, CallRecord.getLimitDate());
call.enqueue(this);
}
use of com.voipgrid.vialer.api.Api in project vialer-android by VoIPGRID.
the class UpdateHelper method enableSecureCalling.
/**
* Migrate secure calling permissions to use secure calling by default.
* V5_2
*/
private void enableSecureCalling() {
AccountHelper accountHelper = new AccountHelper(mContext);
Api mApi = ServiceGenerator.createService(mContext, Api.class, mContext.getString(R.string.api_url), accountHelper.getEmail(), accountHelper.getPassword());
Call<UseEncryption> call = mApi.useEncryption(new UseEncryption(true));
try {
Response response = call.execute();
if (!response.isSuccessful()) {
handleApiFailure(response.code());
}
} catch (IOException e) {
handleApiFailure(0);
}
}
Aggregations