| POST | /consumerinitiation |
|---|
import java.math.*
import java.util.*
import net.servicestack.client.*
/**
* 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)
open class ConsumerInitiation : IPost
{
/**
* Client identifier
*/
@ApiMember(Description="Client identifier", IsRequired=true)
var ClientID:String? = null
/**
* Consumer relocation request file details
*/
@ApiMember(Description="Consumer relocation request file details", IsRequired=true)
var File:RelocationsRequestFile? = null
}
open class RelocationsRequestFile
{
/**
* Command type for the request (INITIATE)
*/
@ApiMember(Description="Command type for the request (INITIATE)", IsRequired=true)
var Command:String? = null
/**
* External identifier for the transferee
*/
@ApiMember(Description="External identifier for the transferee", IsRequired=true)
var ExternalID:String? = null
/**
* Details about the transferee
*/
@ApiMember(Description="Details about the transferee", IsRequired=true)
var TransfereeDetails:RelocationsRequestFileTransfereeDetails? = null
/**
* List of addresses associated with the transferee
*/
@ApiMember(Description="List of addresses associated with the transferee", IsRequired=true)
var Addresses:ArrayList<RelocationsRequestFileAddress>? = null
/**
* List of phone numbers associated with the transferee
*/
@ApiMember(Description="List of phone numbers associated with the transferee", IsRequired=true)
var Phones:ArrayList<RelocationsRequestFilePhone>? = null
/**
* Assignment details for the relocation
*/
@ApiMember(Description="Assignment details for the relocation", IsRequired=true)
var AssignmentDetails:RelocationsRequestFileAssignmentDetails? = null
}
open class RelocationsRequestFileTransfereeDetails
{
/**
* First name of the transferee
*/
@ApiMember(Description="First name of the transferee", IsRequired=true)
var FirstName:String? = null
/**
* Last name of the transferee
*/
@ApiMember(Description="Last name of the transferee", IsRequired=true)
var LastName:String? = null
/**
* Preferred email address
*/
@ApiMember(Description="Preferred email address", IsRequired=true)
var PreferredEmail:String? = null
}
open class RelocationsRequestFileAddress
{
/**
* Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)
*/
@ApiMember(Description="Type of address (CurrentHome, DestinationHome, CurrentWork, DestinationWork)", IsRequired=true)
var AddressType:AddressType? = null
/**
* Indicates if this is the primary address
*/
@ApiMember(Description="Indicates if this is the primary address", IsRequired=true)
var Primary:YesNo? = null
/**
* Address line 1
*/
@ApiMember(Description="Address line 1", IsRequired=true)
var AddressLine1:String? = null
/**
* City
*/
@ApiMember(Description="City", IsRequired=true)
var City:String? = null
/**
* Country
*/
@ApiMember(Description="Country", IsRequired=true)
var Country:String? = null
}
enum class AddressType
{
CurrentHome,
DestinationHome,
CurrentWork,
DestinationWork,
}
enum class YesNo
{
Y,
N,
Item,
}
open class RelocationsRequestFilePhone
{
/**
* Phone type (e.g., Mobile, OriginHome)
*/
@ApiMember(Description="Phone type (e.g., Mobile, OriginHome)", IsRequired=true)
var Type:String? = null
/**
* Indicates if this is the primary phone number
*/
@ApiMember(Description="Indicates if this is the primary phone number", IsRequired=true)
var Primary:YesNo? = null
/**
* Phone number
*/
@ApiMember(Description="Phone number", IsRequired=true)
var Number:String? = null
}
open class RelocationsRequestFileAssignmentDetails
{
/**
* Program name or code
*/
@ApiMember(Description="Program name or code", IsRequired=true)
var Program:String? = null
/**
* Type of assignment
*/
@ApiMember(Description="Type of assignment", IsRequired=true)
var AssignmentType:String? = null
/**
* Assignment start date
*/
@ApiMember(Description="Assignment start date", IsRequired=true)
var StartDate:Date? = null
/**
* Company name
*/
@ApiMember(Description="Company name", IsRequired=true)
var CompanyName:String? = null
/**
* Contact
*/
@ApiMember(Description="Contact", IsRequired=true)
var Contact:String? = null
/**
* Current assignment location details
*/
@ApiMember(Description="Current assignment location details", IsRequired=true)
var Current:AssignmentLocationDetails? = null
/**
* Destination assignment location details
*/
@ApiMember(Description="Destination assignment location details", IsRequired=true)
var Destination:AssignmentLocationDetails? = null
}
open class AssignmentLocationDetails
{
/**
* Work city
*/
@ApiMember(Description="Work city", IsRequired=true)
var WorkCity:String? = null
/**
* Current work location state
*/
@ApiMember(Description="Current work location state")
var CurrentWorkState:String? = null
/**
* Work state or province
*/
@ApiMember(Description="Work state or province")
var WorkState:String? = null
/**
* Destination work location state
*/
@ApiMember(Description="Destination work location state")
var DestinationWorkState:String? = null
/**
* Work country
*/
@ApiMember(Description="Work country", IsRequired=true)
var WorkCountry:String? = null
/**
* Preferred work location state
*/
@ApiMember(Description="Preferred work location state")
var PreferredWorkState:String? = null
/**
* Preferred work location country
*/
@ApiMember(Description="Preferred work location country")
var PreferredWorkCountry:String? = null
}
open class ConsumerInitiationResponse
{
/**
* Response message
*/
@ApiMember(Description="Response message")
var Message:String? = null
/**
* File identifier for the created initiation
*/
@ApiMember(Description="File identifier for the created initiation")
var FileId:String? = null
/**
* List of validation errors, if any
*/
@ApiMember(Description="List of validation errors, if any")
var Errors:ArrayList<ValidateError> = ArrayList<ValidateError>()
}
open class ValidateError
{
var ErrorNumber:String? = null
var ErrorDescription:String? = null
}
Kotlin ConsumerInitiation DTOs
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"}]}