// Path: libs/sms/src/main/java/com/africastalking/sms/FetchMessageResponse.java
// public final class FetchMessageResponse {
// 
//     @SerializedName("SMSMessageData")
//     public SmsMessageData data;
// 
//     public static final class SmsMessageData {
//         @SerializedName("Recipients")
//         public List<Message> messages = new ArrayList<>();
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/FetchSubscriptionResponse.java
// public final class FetchSubscriptionResponse {
//     @SerializedName("Subscriptions")
//     public List<Subscription> subscriptions = new ArrayList<>();
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/Message.java
// public final class Message {
//     public String from;
//     public String to;
//     public String text;
//     public String linkId;
//     public String date;
//     public long id;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/Recipient.java
// public final class Recipient {
//     public String number;
//     public String cost;
//     public String status;
//     public String messageId;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/SendMessageResponse.java
// public final class SendMessageResponse {
// 
//     @SerializedName("SMSMessageData")
//     public SmsMessageData data;
// 
//     public static final class SmsMessageData {
//         @SerializedName("Recipients")
//         public List<Recipient> recipients;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// 
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/Subscription.java
// public final class Subscription {
//     public long id;
//     public String phoneNumber;
//     public String date;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/SubscriptionResponse.java
// public final class SubscriptionResponse {
//     public String success;
//     public String description;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }


import com.africastalking.sms.FetchMessageResponse;
import com.africastalking.sms.FetchSubscriptionResponse;
import com.africastalking.sms.Message;
import com.africastalking.sms.Recipient;
import com.africastalking.sms.SendMessageResponse;
import com.africastalking.sms.Subscription;
import com.africastalking.sms.SubscriptionResponse;
import retrofit2.Response;
import java.io.IOException;
import java.util.List;
import java.util.StringJoiner;
        sms = mRetrofitBuilder.baseUrl(baseUrl).build().create(ISMS.class);
    }

    @Override
    protected boolean isInitialized() {
        return sInstance != null;
    }

    @Override
    protected void destroyService() {
        if (sInstance != null) {
            sInstance = null;
        }
    }

    private String formatRecipients(String[] recipients) throws IOException {

        if (recipients == null){
            return null;
        }

        if (recipients.length == 1) {
            return recipients[0];
        }

        StringJoiner joiner = new StringJoiner(",");
        for (CharSequence cs: recipients) {
            checkPhoneNumber(cs.toString());
            joiner.add(cs);
        }
// Path: libs/sms/src/main/java/com/africastalking/sms/FetchMessageResponse.java
// public final class FetchMessageResponse {
// 
//     @SerializedName("SMSMessageData")
//     public SmsMessageData data;
// 
//     public static final class SmsMessageData {
//         @SerializedName("Recipients")
//         public List<Message> messages = new ArrayList<>();
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/FetchSubscriptionResponse.java
// public final class FetchSubscriptionResponse {
//     @SerializedName("Subscriptions")
//     public List<Subscription> subscriptions = new ArrayList<>();
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/Message.java
// public final class Message {
//     public String from;
//     public String to;
//     public String text;
//     public String linkId;
//     public String date;
//     public long id;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/Recipient.java
// public final class Recipient {
//     public String number;
//     public String cost;
//     public String status;
//     public String messageId;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/SendMessageResponse.java
// public final class SendMessageResponse {
// 
//     @SerializedName("SMSMessageData")
//     public SmsMessageData data;
// 
//     public static final class SmsMessageData {
//         @SerializedName("Recipients")
//         public List<Recipient> recipients;
//     }
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// 
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/Subscription.java
// public final class Subscription {
//     public long id;
//     public String phoneNumber;
//     public String date;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }
// 
// Path: libs/sms/src/main/java/com/africastalking/sms/SubscriptionResponse.java
// public final class SubscriptionResponse {
//     public String success;
//     public String description;
// 
//     @Override
//     public String toString() {
//         return new Gson().toJson(this);
//     }
// }


// Path: libs/sms/src/main/java/com/africastalking/SmsService.java
import com.africastalking.sms.FetchMessageResponse;
import com.africastalking.sms.FetchSubscriptionResponse;
import com.africastalking.sms.Message;
import com.africastalking.sms.Recipient;
import com.africastalking.sms.SendMessageResponse;
import com.africastalking.sms.Subscription;
import com.africastalking.sms.SubscriptionResponse;
import retrofit2.Response;
import java.io.IOException;
import java.util.List;
import java.util.StringJoiner;

        sms = mRetrofitBuilder.baseUrl(baseUrl).build().create(ISMS.class);
    }

    @Override
    protected boolean isInitialized() {
        return sInstance != null;
    }

    @Override
    protected void destroyService() {
        if (sInstance != null) {
            sInstance = null;
        }
    }

    private String formatRecipients(String[] recipients) throws IOException {

        if (recipients == null){
            return null;
        }

        if (recipients.length == 1) {
            return recipients[0];
        }

        StringJoiner joiner = new StringJoiner(",");
        for (CharSequence cs: recipients) {
            checkPhoneNumber(cs.toString());
            joiner.add(cs);
        }
        return joiner.toString();