import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
@DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")
public static class RestSmsRequest
{
/**
* API Username. Usually your customer id
*/
@DataMember(Name="Username")
@SerializedName("Username")
@ApiMember(DataType="string", Description="API Username. Usually your customer id", IsRequired=true, Name="Username", ParameterType="form")
@StringLength(MaximumLength=128)
public Object username = null;
/**
* API Password
*/
@DataMember(Name="Password")
@SerializedName("Password")
@ApiMember(DataType="string", Description="API Password", IsRequired=true, Name="Password", ParameterType="form")
@StringLength(MaximumLength=128)
public String password = null;
/**
* Collection of messages to send
*/
@DataMember(Name="Messages")
@SerializedName("Messages")
@ApiMember(Description="Collection of messages to send", IsRequired=true, Name="Messages", ParameterType="form")
public ArrayList<RestSmsMessageReq> messages = new ArrayList<RestSmsMessageReq>();
public Object getUsername() { return username; }
public RestSmsRequest setUsername(Object value) { this.username = value; return this; }
public String getPassword() { return password; }
public RestSmsRequest setPassword(String value) { this.password = value; return this; }
public ArrayList<RestSmsMessageReq> getMessages() { return messages; }
public RestSmsRequest setMessages(ArrayList<RestSmsMessageReq> value) { this.messages = value; return this; }
}
@DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")
public static class RestSmsMessageReq
{
/**
* Gateway number. Default 99700999 for cross country delivery, non premium messages
*/
@DataMember(Name="Gateway")
@SerializedName("Gateway")
@ApiMember(DataType="integer", Description="Gateway number. Default 99700999 for cross country delivery, non premium messages", IsRequired=true, Name="Gateway", ParameterType="form")
public Object gateway = null;
/**
* Originator address. Defaults to gateway number if not set. Maximum 11 chars if using alphanumeric value. See documentation for full details.
*/
@DataMember(Name="OriginatorAddress")
@SerializedName("OriginatorAddress")
@ApiMember(DataType="string", Description="Originator address. Defaults to gateway number if not set. Maximum 11 chars if using alphanumeric value. See documentation for full details.", Name="OriginatorAddress", ParameterType="form")
public Object originatorAddress = null;
/**
* Destination address.The recipient of the message. Must be a valid MSISDN
*/
@DataMember(Name="DestinationAddress")
@SerializedName("DestinationAddress")
@ApiMember(DataType="integer", Description="Destination address.The recipient of the message. Must be a valid MSISDN", IsRequired=true, Name="DestinationAddress", ParameterType="form")
public Object destinationAddress = null;
/**
* Price to bill recipient. Premium messaging. Leave value to 0 if not using premium. Premium is only available on short number gateway number for each country available in documentation
*/
@DataMember(Name="Price")
@SerializedName("Price")
@ApiMember(DataType="integer", Description="Price to bill recipient. Premium messaging. Leave value to 0 if not using premium. Premium is only available on short number gateway number for each country available in documentation", IsRequired=true, Name="Price", ParameterType="form")
public Object price = null;
/**
* Message type according to documentation. Defaults to 00 if not set. If text length is above 160 chars, it defaults to value 11
*/
@DataMember(Name="MessageType")
@SerializedName("MessageType")
@ApiMember(DataType="string", Description="Message type according to documentation. Defaults to 00 if not set. If text length is above 160 chars, it defaults to value 11", Name="MessageType", ParameterType="form")
public String messageType = null;
/**
* Delivery expire timestamp (yyyymmddhhmmss) or relative value. See documentation and default value if not defined
*/
@DataMember(Name="ValidationPeriod")
@SerializedName("ValidationPeriod")
@ApiMember(DataType="string", Description="Delivery expire timestamp (yyyymmddhhmmss) or relative value. See documentation and default value if not defined", Name="ValidationPeriod", ParameterType="form")
public Object validationPeriod = null;
/**
* Your unique message id to track delivery status and response from sending process
*/
@DataMember(Name="MessageId")
@SerializedName("MessageId")
@ApiMember(DataType="string", Description="Your unique message id to track delivery status and response from sending process", Name="MessageId", ParameterType="form")
public String messageId = null;
/**
* GSM User Data Header (HEX)
*/
@DataMember(Name="UserDataHeader")
@SerializedName("UserDataHeader")
@ApiMember(DataType="string", Description="GSM User Data Header (HEX)", Name="UserDataHeader", ParameterType="form")
public String userDataHeader = null;
/**
* GSM User Data. Plain text or hex encoded. Depending on the used MessageType
*/
@DataMember(Name="UserData")
@SerializedName("UserData")
@ApiMember(DataType="string", Description="GSM User Data. Plain text or hex encoded. Depending on the used MessageType", IsRequired=true, Name="UserData", ParameterType="form")
public String userData = null;
/**
* Parameter to categorize messages on payment bill from Intele
*/
@DataMember(Name="Category")
@SerializedName("Category")
@ApiMember(DataType="string", Description="Parameter to categorize messages on payment bill from Intele", Name="Category", ParameterType="form")
public String category = null;
/**
* Custom key/value attributes for the Sms Text Message. See documentation for further details
*/
@DataMember(Name="CustomData")
@SerializedName("CustomData")
@ApiMember(DataType="string", Description="Custom key/value attributes for the Sms Text Message. See documentation for further details", Name="CustomData", ParameterType="form")
public HashMap<String,Object> customData = null;
/**
* Url where Intele should send delivery report. See documentation for url formatting
*/
@DataMember(Name="DeliveryReportUrl")
@SerializedName("DeliveryReportUrl")
@ApiMember(DataType="string", Description="Url where Intele should send delivery report. See documentation for url formatting", Name="DeliveryReportUrl", ParameterType="form")
public String deliveryReportUrl = null;
/**
* For Premium messaging only. See documentation for further details
*/
@DataMember(Name="ServiceCode")
@SerializedName("ServiceCode")
@ApiMember(DataType="string", Description="For Premium messaging only. See documentation for further details", Name="ServiceCode", ParameterType="form")
public String serviceCode = null;
/**
* For Premium messaging only. See documentation for further details
*/
@DataMember(Name="ServiceDescription")
@SerializedName("ServiceDescription")
@ApiMember(DataType="string", Description="For Premium messaging only. See documentation for further details", Name="ServiceDescription", ParameterType="form")
public String serviceDescription = null;
public Object getGateway() { return gateway; }
public RestSmsMessageReq setGateway(Object value) { this.gateway = value; return this; }
public Object getOriginatorAddress() { return originatorAddress; }
public RestSmsMessageReq setOriginatorAddress(Object value) { this.originatorAddress = value; return this; }
public Object getDestinationAddress() { return destinationAddress; }
public RestSmsMessageReq setDestinationAddress(Object value) { this.destinationAddress = value; return this; }
public Object getPrice() { return price; }
public RestSmsMessageReq setPrice(Object value) { this.price = value; return this; }
public String getMessageType() { return messageType; }
public RestSmsMessageReq setMessageType(String value) { this.messageType = value; return this; }
public Object getValidationPeriod() { return validationPeriod; }
public RestSmsMessageReq setValidationPeriod(Object value) { this.validationPeriod = value; return this; }
public String getMessageId() { return messageId; }
public RestSmsMessageReq setMessageId(String value) { this.messageId = value; return this; }
public String getUserDataHeader() { return userDataHeader; }
public RestSmsMessageReq setUserDataHeader(String value) { this.userDataHeader = value; return this; }
public String getUserData() { return userData; }
public RestSmsMessageReq setUserData(String value) { this.userData = value; return this; }
public String getCategory() { return category; }
public RestSmsMessageReq setCategory(String value) { this.category = value; return this; }
public HashMap<String,Object> getCustomData() { return customData; }
public RestSmsMessageReq setCustomData(HashMap<String,Object> value) { this.customData = value; return this; }
public String getDeliveryReportUrl() { return deliveryReportUrl; }
public RestSmsMessageReq setDeliveryReportUrl(String value) { this.deliveryReportUrl = value; return this; }
public String getServiceCode() { return serviceCode; }
public RestSmsMessageReq setServiceCode(String value) { this.serviceCode = value; return this; }
public String getServiceDescription() { return serviceDescription; }
public RestSmsMessageReq setServiceDescription(String value) { this.serviceDescription = value; return this; }
}
@DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")
public static class RestSmsResponse
{
/**
* Overall status of processing the request. Each message will have it's own status. This value indicates if any other error occured or not
*/
@DataMember(Name="ProcessResult")
@SerializedName("ProcessResult")
@ApiMember(DataType="boolean", Description="Overall status of processing the request. Each message will have it's own status. This value indicates if any other error occured or not", IsRequired=true, Name="ProcessResult", ParameterType="form")
public Boolean processResult = null;
/**
* Description of any error occured, if ProcessResult equals false
*/
@DataMember(Name="ProcessResultDescription")
@SerializedName("ProcessResultDescription")
@ApiMember(DataType="string", Description="Description of any error occured, if ProcessResult equals false", Name="ProcessResultDescription", ParameterType="form")
@StringLength(MaximumLength=2048)
public String processResultDescription = null;
/**
* Collection of messages sent or failed
*/
@DataMember(Name="Messages")
@SerializedName("Messages")
@ApiMember(Description="Collection of messages sent or failed", Name="Description", ParameterType="form")
public ArrayList<RestSmsMessageResp> messages = new ArrayList<RestSmsMessageResp>();
public Boolean isProcessResult() { return processResult; }
public RestSmsResponse setProcessResult(Boolean value) { this.processResult = value; return this; }
public String getProcessResultDescription() { return processResultDescription; }
public RestSmsResponse setProcessResultDescription(String value) { this.processResultDescription = value; return this; }
public ArrayList<RestSmsMessageResp> getMessages() { return messages; }
public RestSmsResponse setMessages(ArrayList<RestSmsMessageResp> value) { this.messages = value; return this; }
}
@DataContract(Namespace="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto")
public static class RestSmsMessageResp
{
/**
* Result of sending message. 0 if success. See documentation for full list of codes
*/
@DataMember(Name="StatusCode")
@SerializedName("StatusCode")
@ApiMember(DataType="integer", Description="Result of sending message. 0 if success. See documentation for full list of codes", IsRequired=true, Name="StatusCode", ParameterType="form")
public Integer statusCode = null;
/**
* Describes the result of sending Sms text message
*/
@DataMember(Name="StatusDescription")
@SerializedName("StatusDescription")
@ApiMember(DataType="string", Description="Describes the result of sending Sms text message", IsRequired=true, Name="StatusDescription", ParameterType="form")
public String statusDescription = null;
/**
* Your unique message id from send request message item. Will be empty if you did not provide any id in the request item.
*/
@DataMember(Name="MessageId")
@SerializedName("MessageId")
@ApiMember(DataType="string", Description="Your unique message id from send request message item. Will be empty if you did not provide any id in the request item.", Name="MessageId", ParameterType="form")
public String messageId = null;
/**
* Unique transaction id from server
*/
@DataMember(Name="TransactionId")
@SerializedName("TransactionId")
@ApiMember(DataType="string", Description="Unique transaction id from server", IsRequired=true, Name="TransactionId", ParameterType="form")
public String transactionId = null;
/**
* Key/Value attributes returned from server. E.g. subnumref and the server name that processed the message. Eg. subnumref=19331234567891,server=smsgw1
*/
@DataMember(Name="ExtraInfo")
@SerializedName("ExtraInfo")
@ApiMember(DataType="string", Description="Key/Value attributes returned from server. E.g. subnumref and the server name that processed the message. Eg. subnumref=19331234567891,server=smsgw1", Name="ExtraInfo", ParameterType="form")
public HashMap<String,String> extraInfo = null;
public Integer getStatusCode() { return statusCode; }
public RestSmsMessageResp setStatusCode(Integer value) { this.statusCode = value; return this; }
public String getStatusDescription() { return statusDescription; }
public RestSmsMessageResp setStatusDescription(String value) { this.statusDescription = value; return this; }
public String getMessageId() { return messageId; }
public RestSmsMessageResp setMessageId(String value) { this.messageId = value; return this; }
public String getTransactionId() { return transactionId; }
public RestSmsMessageResp setTransactionId(String value) { this.transactionId = value; return this; }
public HashMap<String,String> getExtraInfo() { return extraInfo; }
public RestSmsMessageResp setExtraInfo(HashMap<String,String> value) { this.extraInfo = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /xml/reply/RestSmsRequest HTTP/1.1
Host: smsgw.intele.no
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<RestSmsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto">
<Messages>
<RestSmsMessageReq>
<Category>String</Category>
<CustomData xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:KeyValueOfstringanyType>
<d4p1:Key>String</d4p1:Key>
<d4p1:Value />
</d4p1:KeyValueOfstringanyType>
</CustomData>
<DeliveryReportUrl>String</DeliveryReportUrl>
<DestinationAddress />
<Gateway />
<MessageId>String</MessageId>
<MessageType>String</MessageType>
<OriginatorAddress />
<Price />
<ServiceCode>String</ServiceCode>
<ServiceDescription>String</ServiceDescription>
<UserData>String</UserData>
<UserDataHeader>String</UserDataHeader>
<ValidationPeriod />
</RestSmsMessageReq>
</Messages>
<Password>String</Password>
<Username />
</RestSmsRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <RestSmsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PushSmsLib.Dto"> <Messages> <RestSmsMessageResp> <ExtraInfo xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringstring> <d4p1:Key>String</d4p1:Key> <d4p1:Value>String</d4p1:Value> </d4p1:KeyValueOfstringstring> </ExtraInfo> <MessageId>String</MessageId> <StatusCode>0</StatusCode> <StatusDescription>String</StatusDescription> <TransactionId>String</TransactionId> </RestSmsMessageResp> </Messages> <ProcessResult>false</ProcessResult> <ProcessResultDescription>String</ProcessResultDescription> </RestSmsResponse>