
com.plivo.api.models.base.MessagingProfileUpdater Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plivo-java Show documentation
Show all versions of plivo-java Show documentation
A Java SDK to make voice calls & send SMS using Plivo and to generate Plivo XML
package com.plivo.api.models.base;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.plivo.api.PlivoClient;
import com.plivo.api.exceptions.PlivoValidationException;
import com.plivo.api.exceptions.InvalidRequestException;
import com.plivo.api.exceptions.PlivoRestException;
import java.io.IOException;
import retrofit2.Call;
import retrofit2.Response;
@JsonInclude(Include.NON_NULL)
public abstract class MessagingProfileUpdater extends BaseRequest {
@JsonIgnore
protected String id;
@JsonIgnore
protected String secondaryId;
public MessagingProfileUpdater(String id) {
this.id = id;
if (id == null) {
throw new IllegalArgumentException("id cannot be null");
}
}
public MessagingProfileUpdater(String id, String secondaryId) {
if (id == null || secondaryId == null) {
throw new IllegalArgumentException("id/secondaryId cannot be null");
}
this.id = id;
this.secondaryId = secondaryId;
}
/**
* Actually update the resource.
*/
public T update() throws IOException, PlivoRestException, PlivoValidationException {
validate();
Response response = obtainCall().execute();
handleResponse(response);
return response.body();
}
@Override
public MessagingProfileUpdater client(final PlivoClient plivoClient) {
this.plivoClient = plivoClient;
return this;
}
protected abstract Call obtainCall() throws PlivoValidationException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy