POST, GET | /api/C2BGetSchoolInfo |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* C2BGetSchoolInfoRequires active-e Contracts Service.
*/
@DataContract
public static class C2BGetSchoolInfoRequest extends BaseRequest
{
/**
* If sent, only schools associated with the sent plan code will be returned.
*/
@DataMember
@ApiMember(DataType="string", Description="If sent, only schools associated with the sent plan code will be returned.", Name="PlanCode", ParameterType="query")
public String PlanCode = null;
/**
* If sent, only schools associated with the sent district will be returned.
*/
@DataMember
@ApiMember(DataType="integer", Description="If sent, only schools associated with the sent district will be returned.", Format="int64", Name="DistrictId", ParameterType="query")
public Long DistrictId = null;
/**
* ID of the Instrument record. Optional.
*/
@DataMember
@ApiMember(DataType="integer", Description="ID of the Instrument record. Optional.", Format="int64", Name="RinPk", ParameterType="query")
public Long RinPk = null;
/**
* Optional Request Type. Valid values are Contract and Shipping.
*/
@DataMember
@ApiMember(DataType="string", Description="Optional Request Type. Valid values are Contract and Shipping.", Name="RequestType", ParameterType="query")
public String RequestType = null;
public String getPlanCode() { return PlanCode; }
public C2BGetSchoolInfoRequest setPlanCode(String value) { this.PlanCode = value; return this; }
public Long getDistrictId() { return DistrictId; }
public C2BGetSchoolInfoRequest setDistrictId(Long value) { this.DistrictId = value; return this; }
public Long getRinPk() { return RinPk; }
public C2BGetSchoolInfoRequest setRinPk(Long value) { this.RinPk = value; return this; }
public String getRequestType() { return RequestType; }
public C2BGetSchoolInfoRequest setRequestType(String value) { this.RequestType = value; return this; }
}
@DataContract
public static class BaseRequest
{
/**
* This is your AIM API Key provided by Tri-Tech
*/
@DataMember
@ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
public String ApiKey = null;
@DataMember
@ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
public String OAuthToken = null;
public String getApiKey() { return ApiKey; }
public BaseRequest setApiKey(String value) { this.ApiKey = value; return this; }
public String getOAuthToken() { return OAuthToken; }
public BaseRequest setOAuthToken(String value) { this.OAuthToken = value; return this; }
}
@DataContract
public static class C2BGetSchoolInfoResponse extends BaseResponse
{
@DataMember
public ArrayList<C2BSchoolGeneric> Schools = null;
public ArrayList<C2BSchoolGeneric> getSchools() { return Schools; }
public C2BGetSchoolInfoResponse setSchools(ArrayList<C2BSchoolGeneric> value) { this.Schools = value; return this; }
}
@DataContract
public static class BaseResponse
{
/**
*
*/
@DataMember
@ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
public BaseResponseResult Status = null;
public BaseResponseResult getStatus() { return Status; }
public BaseResponse setStatus(BaseResponseResult value) { this.Status = value; return this; }
}
@DataContract
public static class BaseResponseResult
{
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
public String StatusCode = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
public String Login = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
public String ErrorCode = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
public String ErrorDisplayText = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
public String ErrorMessage = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
public String DomainName = null;
/**
*
*/
@DataMember
@ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
public String IpAddress = null;
public String getStatusCode() { return StatusCode; }
public BaseResponseResult setStatusCode(String value) { this.StatusCode = value; return this; }
public String getLogin() { return Login; }
public BaseResponseResult setLogin(String value) { this.Login = value; return this; }
public String getErrorCode() { return ErrorCode; }
public BaseResponseResult setErrorCode(String value) { this.ErrorCode = value; return this; }
public String getErrorDisplayText() { return ErrorDisplayText; }
public BaseResponseResult setErrorDisplayText(String value) { this.ErrorDisplayText = value; return this; }
public String getErrorMessage() { return ErrorMessage; }
public BaseResponseResult setErrorMessage(String value) { this.ErrorMessage = value; return this; }
public String getDomainName() { return DomainName; }
public BaseResponseResult setDomainName(String value) { this.DomainName = value; return this; }
public String getIpAddress() { return IpAddress; }
public BaseResponseResult setIpAddress(String value) { this.IpAddress = value; return this; }
}
@DataContract
public static class C2BSchoolGeneric
{
@DataMember
public String SchoolName = null;
@DataMember
public String DistrictName = null;
@DataMember
public Integer TeacherCount = null;
@DataMember
public String Topic = null;
@DataMember
public Long Id = null;
@DataMember
public C2BDeliveryInfo DeliveryInfo = null;
@DataMember
public Long AIMSchoolId = null;
public String getSchoolName() { return SchoolName; }
public C2BSchoolGeneric setSchoolName(String value) { this.SchoolName = value; return this; }
public String getDistrictName() { return DistrictName; }
public C2BSchoolGeneric setDistrictName(String value) { this.DistrictName = value; return this; }
public Integer getTeacherCount() { return TeacherCount; }
public C2BSchoolGeneric setTeacherCount(Integer value) { this.TeacherCount = value; return this; }
public String getTopic() { return Topic; }
public C2BSchoolGeneric setTopic(String value) { this.Topic = value; return this; }
public Long getId() { return Id; }
public C2BSchoolGeneric setId(Long value) { this.Id = value; return this; }
public C2BDeliveryInfo getDeliveryInfo() { return DeliveryInfo; }
public C2BSchoolGeneric setDeliveryInfo(C2BDeliveryInfo value) { this.DeliveryInfo = value; return this; }
public Long getAimSchoolId() { return AIMSchoolId; }
public C2BSchoolGeneric setAimSchoolId(Long value) { this.AIMSchoolId = value; return this; }
}
@DataContract
public static class C2BDeliveryInfo
{
@DataMember
public Date FirstDelivery = null;
@DataMember
public Date DeliveryTime = null;
@DataMember
public Integer DeliveryThreshold = null;
@DataMember
public Boolean SundayDelivery = null;
@DataMember
public Boolean MondayDelivery = null;
@DataMember
public Boolean TuesdayDelivery = null;
@DataMember
public Boolean WednesdayDelivery = null;
@DataMember
public Boolean ThursdayDelivery = null;
@DataMember
public Boolean FridayDelivery = null;
@DataMember
public Boolean SaturdayDelivery = null;
public Date getFirstDelivery() { return FirstDelivery; }
public C2BDeliveryInfo setFirstDelivery(Date value) { this.FirstDelivery = value; return this; }
public Date getDeliveryTime() { return DeliveryTime; }
public C2BDeliveryInfo setDeliveryTime(Date value) { this.DeliveryTime = value; return this; }
public Integer getDeliveryThreshold() { return DeliveryThreshold; }
public C2BDeliveryInfo setDeliveryThreshold(Integer value) { this.DeliveryThreshold = value; return this; }
public Boolean isSundayDelivery() { return SundayDelivery; }
public C2BDeliveryInfo setSundayDelivery(Boolean value) { this.SundayDelivery = value; return this; }
public Boolean isMondayDelivery() { return MondayDelivery; }
public C2BDeliveryInfo setMondayDelivery(Boolean value) { this.MondayDelivery = value; return this; }
public Boolean isTuesdayDelivery() { return TuesdayDelivery; }
public C2BDeliveryInfo setTuesdayDelivery(Boolean value) { this.TuesdayDelivery = value; return this; }
public Boolean isWednesdayDelivery() { return WednesdayDelivery; }
public C2BDeliveryInfo setWednesdayDelivery(Boolean value) { this.WednesdayDelivery = value; return this; }
public Boolean isThursdayDelivery() { return ThursdayDelivery; }
public C2BDeliveryInfo setThursdayDelivery(Boolean value) { this.ThursdayDelivery = value; return this; }
public Boolean isFridayDelivery() { return FridayDelivery; }
public C2BDeliveryInfo setFridayDelivery(Boolean value) { this.FridayDelivery = value; return this; }
public Boolean isSaturdayDelivery() { return SaturdayDelivery; }
public C2BDeliveryInfo setSaturdayDelivery(Boolean value) { this.SaturdayDelivery = value; return this; }
}
}
Java C2BGetSchoolInfoRequest DTOs
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 /api/C2BGetSchoolInfo HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<C2BGetSchoolInfoRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<DistrictId>0</DistrictId>
<PlanCode>String</PlanCode>
<RequestType>String</RequestType>
<RinPk>0</RinPk>
</C2BGetSchoolInfoRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <C2BGetSchoolInfoResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> <Schools xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM"> <d2p1:C2BSchoolGeneric i:nil="true" /> </Schools> </C2BGetSchoolInfoResponse>