| POST | /consumerinitiation |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
/**
* Consumer Initiation Service
*/
@Api(Description="Consumer Initiation Service")
@ApiResponse(Description="Returned when the consumer initiation was successfully processed", StatusCode=200)
// @ApiResponse(Description="Returned if the request validation failed", StatusCode=400)
// @ApiResponse(Description="Returned if the client is not authorized", StatusCode=401)
// @ApiResponse(Description="Returned if an error occurred while processing the request", StatusCode=500)
public static class ConsumerInitiation implements IPost
{
/**
* Client identifier
*/
@ApiMember(Description="Client identifier", IsRequired=true)
public String ClientID = null;
/**
* Consumer relocation request file details
*/
@ApiMember(Description="Consumer relocation request file details", IsRequired=true)
public RelocationsRequestFile File = null;
public String getClientID() { return ClientID; }
public ConsumerInitiation setClientID(String value) { this.ClientID = value; return this; }
public RelocationsRequestFile getFile() { return File; }
public ConsumerInitiation setFile(RelocationsRequestFile value) { this.File = value; return this; }
}
public static class RelocationsRequestFile
{
/**
* Command type for the request (INITIATE)
*/
@ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)
public String Command = null;
/**
* External identifier for the transferee
*/
@ApiMember(Description="External identifier for the transferee", IsRequired=true)
public String ExternalID = null;
/**
* Details about the transferee
*/
@ApiMember(Description="Details about the transferee", IsRequired=true)
public RelocationsRequestFileTransfereeDetails TransfereeDetails = null;
/**
* List of addresses associated with the transferee
*/
@ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)
public ArrayList<RelocationsRequestFileAddress> Addresses = null;
/**
* List of phone numbers associated with the transferee
*/
@ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)
public ArrayList<RelocationsRequestFilePhone> Phones = null;
/**
* Assignment details for the relocation
*/
@ApiMember(Description="Assignment details for the relocation", IsRequired=true)
public RelocationsRequestFileAssignmentDetails AssignmentDetails = null;
public String getCommand() { return Command; }
public RelocationsRequestFile setCommand(String value) { this.Command = value; return this; }
public String getExternalID() { return ExternalID; }
public RelocationsRequestFile setExternalID(String value) { this.ExternalID = value; return this; }
public RelocationsRequestFileTransfereeDetails getTransfereeDetails() { return TransfereeDetails; }
public RelocationsRequestFile setTransfereeDetails(RelocationsRequestFileTransfereeDetails value) { this.TransfereeDetails = value; return this; }
public ArrayList<RelocationsRequestFileAddress> getAddresses() { return Addresses; }
public RelocationsRequestFile setAddresses(ArrayList<RelocationsRequestFileAddress> value) { this.Addresses = value; return this; }
public ArrayList<RelocationsRequestFilePhone> getPhones() { return Phones; }
public RelocationsRequestFile setPhones(ArrayList<RelocationsRequestFilePhone> value) { this.Phones = value; return this; }
public RelocationsRequestFileAssignmentDetails getAssignmentDetails() { return AssignmentDetails; }
public RelocationsRequestFile setAssignmentDetails(RelocationsRequestFileAssignmentDetails value) { this.AssignmentDetails = value; return this; }
}
public static class RelocationsRequestFileTransfereeDetails
{
/**
* First name of the transferee
*/
@ApiMember(Description="First name of the transferee", IsRequired=true)
public String FirstName = null;
/**
* Last name of the transferee
*/
@ApiMember(Description="Last name of the transferee", IsRequired=true)
public String LastName = null;
/**
* Preferred email address
*/
@ApiMember(Description="Preferred email address", IsRequired=true)
public String PreferredEmail = null;
public String getFirstName() { return FirstName; }
public RelocationsRequestFileTransfereeDetails setFirstName(String value) { this.FirstName = value; return this; }
public String getLastName() { return LastName; }
public RelocationsRequestFileTransfereeDetails setLastName(String value) { this.LastName = value; return this; }
public String getPreferredEmail() { return PreferredEmail; }
public RelocationsRequestFileTransfereeDetails setPreferredEmail(String value) { this.PreferredEmail = value; return this; }
}
public static class RelocationsRequestFileAddress
{
/**
* Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)
*/
@ApiMember(Description="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired=true)
public AddressType AddressType = null;
/**
* Indicates if this is the primary address
*/
@ApiMember(Description="Indicates if this is the primary address", IsRequired=true)
public YesNo Primary = null;
/**
* Address line 1
*/
@ApiMember(Description="Address line 1", IsRequired=true)
public String AddressLine1 = null;
/**
* City
*/
@ApiMember(Description="City", IsRequired=true)
public String City = null;
/**
* Country
*/
@ApiMember(Description="Country", IsRequired=true)
public String Country = null;
public AddressType getAddressType() { return AddressType; }
public RelocationsRequestFileAddress setAddressType(AddressType value) { this.AddressType = value; return this; }
public YesNo getPrimary() { return Primary; }
public RelocationsRequestFileAddress setPrimary(YesNo value) { this.Primary = value; return this; }
public String getAddressLine1() { return AddressLine1; }
public RelocationsRequestFileAddress setAddressLine1(String value) { this.AddressLine1 = value; return this; }
public String getCity() { return City; }
public RelocationsRequestFileAddress setCity(String value) { this.City = value; return this; }
public String getCountry() { return Country; }
public RelocationsRequestFileAddress setCountry(String value) { this.Country = value; return this; }
}
public static enum AddressType
{
CurrentHome,
DestinationHome,
CurrentWork,
DestinationWork;
}
public static enum YesNo
{
Y,
N,
Item;
}
public static class RelocationsRequestFilePhone
{
/**
* Phone type (e.g., Mobile, OriginHome)
*/
@ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)
public String Type = null;
/**
* Indicates if this is the primary phone number
*/
@ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)
public YesNo Primary = null;
/**
* Phone number
*/
@ApiMember(Description="Phone number", IsRequired=true)
public String Number = null;
public String getType() { return Type; }
public RelocationsRequestFilePhone setType(String value) { this.Type = value; return this; }
public YesNo getPrimary() { return Primary; }
public RelocationsRequestFilePhone setPrimary(YesNo value) { this.Primary = value; return this; }
public String getNumber() { return Number; }
public RelocationsRequestFilePhone setNumber(String value) { this.Number = value; return this; }
}
public static class RelocationsRequestFileAssignmentDetails
{
/**
* Program name or code
*/
@ApiMember(Description="Program name or code", IsRequired=true)
public String Program = null;
/**
* Type of assignment
*/
@ApiMember(Description="Type of assignment", IsRequired=true)
public String AssignmentType = null;
/**
* Assignment start date
*/
@ApiMember(Description="Assignment start date", IsRequired=true)
public Date StartDate = null;
/**
* Company name
*/
@ApiMember(Description="Company name", IsRequired=true)
public String CompanyName = null;
/**
* Contact
*/
@ApiMember(Description="Contact", IsRequired=true)
public String Contact = null;
/**
* Current assignment location details
*/
@ApiMember(Description="Current assignment location details", IsRequired=true)
public AssignmentLocationDetails Current = null;
/**
* Destination assignment location details
*/
@ApiMember(Description="Destination assignment location details", IsRequired=true)
public AssignmentLocationDetails Destination = null;
public String getProgram() { return Program; }
public RelocationsRequestFileAssignmentDetails setProgram(String value) { this.Program = value; return this; }
public String getAssignmentType() { return AssignmentType; }
public RelocationsRequestFileAssignmentDetails setAssignmentType(String value) { this.AssignmentType = value; return this; }
public Date getStartDate() { return StartDate; }
public RelocationsRequestFileAssignmentDetails setStartDate(Date value) { this.StartDate = value; return this; }
public String getCompanyName() { return CompanyName; }
public RelocationsRequestFileAssignmentDetails setCompanyName(String value) { this.CompanyName = value; return this; }
public String getContact() { return Contact; }
public RelocationsRequestFileAssignmentDetails setContact(String value) { this.Contact = value; return this; }
public AssignmentLocationDetails getCurrent() { return Current; }
public RelocationsRequestFileAssignmentDetails setCurrent(AssignmentLocationDetails value) { this.Current = value; return this; }
public AssignmentLocationDetails getDestination() { return Destination; }
public RelocationsRequestFileAssignmentDetails setDestination(AssignmentLocationDetails value) { this.Destination = value; return this; }
}
public static class AssignmentLocationDetails
{
/**
* Work city
*/
@ApiMember(Description="Work city", IsRequired=true)
public String WorkCity = null;
/**
* Current work location state
*/
@ApiMember(Description="Current work location state")
public String CurrentWorkState = null;
/**
* Work state or province
*/
@ApiMember(Description="Work state or province")
public String WorkState = null;
/**
* Destination work location state
*/
@ApiMember(Description="Destination work location state")
public String DestinationWorkState = null;
/**
* Work country
*/
@ApiMember(Description="Work country", IsRequired=true)
public String WorkCountry = null;
/**
* Preferred work location state
*/
@ApiMember(Description="Preferred work location state")
public String PreferredWorkState = null;
/**
* Preferred work location country
*/
@ApiMember(Description="Preferred work location country")
public String PreferredWorkCountry = null;
public String getWorkCity() { return WorkCity; }
public AssignmentLocationDetails setWorkCity(String value) { this.WorkCity = value; return this; }
public String getCurrentWorkState() { return CurrentWorkState; }
public AssignmentLocationDetails setCurrentWorkState(String value) { this.CurrentWorkState = value; return this; }
public String getWorkState() { return WorkState; }
public AssignmentLocationDetails setWorkState(String value) { this.WorkState = value; return this; }
public String getDestinationWorkState() { return DestinationWorkState; }
public AssignmentLocationDetails setDestinationWorkState(String value) { this.DestinationWorkState = value; return this; }
public String getWorkCountry() { return WorkCountry; }
public AssignmentLocationDetails setWorkCountry(String value) { this.WorkCountry = value; return this; }
public String getPreferredWorkState() { return PreferredWorkState; }
public AssignmentLocationDetails setPreferredWorkState(String value) { this.PreferredWorkState = value; return this; }
public String getPreferredWorkCountry() { return PreferredWorkCountry; }
public AssignmentLocationDetails setPreferredWorkCountry(String value) { this.PreferredWorkCountry = value; return this; }
}
public static class ConsumerInitiationResponse
{
/**
* Response message
*/
@ApiMember(Description="Response message")
public String Message = null;
/**
* File identifier for the created initiation
*/
@ApiMember(Description="File identifier for the created initiation")
public String FileId = null;
/**
* List of validation errors, if any
*/
@ApiMember(Description="List of validation errors, if any")
public ArrayList<ValidateError> Errors = null;
public String getMessage() { return Message; }
public ConsumerInitiationResponse setMessage(String value) { this.Message = value; return this; }
public String getFileId() { return FileId; }
public ConsumerInitiationResponse setFileId(String value) { this.FileId = value; return this; }
public ArrayList<ValidateError> getErrors() { return Errors; }
public ConsumerInitiationResponse setErrors(ArrayList<ValidateError> value) { this.Errors = value; return this; }
}
public static class ValidateError
{
public String ErrorNumber = null;
public String ErrorDescription = null;
public String getErrorNumber() { return ErrorNumber; }
public ValidateError setErrorNumber(String value) { this.ErrorNumber = value; return this; }
public String getErrorDescription() { return ErrorDescription; }
public ValidateError setErrorDescription(String value) { this.ErrorDescription = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /consumerinitiation HTTP/1.1
Host: initiation-pen.sirva.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ClientID":"String","File":{"Command":"String","ExternalID":"String","TransfereeDetails":{"FirstName":"String","LastName":"String","PreferredEmail":"String"},"Addresses":[{"AddressType":"CurrentHome","Primary":"Y","AddressLine1":"String","City":"String","Country":"String"}],"Phones":[{"Type":"String","Primary":"Y","Number":"String"}],"AssignmentDetails":{"Program":"String","AssignmentType":"String","StartDate":"\/Date(-62135596800000-0000)\/","CompanyName":"String","Contact":"String","Current":{"WorkCity":"String","CurrentWorkState":"String","WorkState":"String","DestinationWorkState":"String","WorkCountry":"String","PreferredWorkState":"String","PreferredWorkCountry":"String"},"Destination":{"WorkCity":"String","CurrentWorkState":"String","WorkState":"String","DestinationWorkState":"String","WorkCountry":"String","PreferredWorkState":"String","PreferredWorkCountry":"String"}}}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"Message":"String","FileId":"String","Errors":[{"ErrorNumber":"String","ErrorDescription":"String"}]}