using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using FrameworkApi.Models;
namespace FrameworkApi.Models
{
///<summary>
///Retrieves communications from the Communication database to be saved to Framework
///</summary>
[Api(Description="Retrieves communications from the Communication database to be saved to Framework")]
public partial class GetCommunicationData
: ISubscription
{
///<summary>
///Bin Row Version of the last update
///</summary>
[ApiMember(DataType="byte[]", Description="Bin Row Version of the last update", Name="BinRowVersion")]
public virtual byte[] BinRowVersion { get; set; }
///<summary>
///Suite Data Source Instance Id to determine which licensees data to retrieve.
///</summary>
[ApiMember(DataType="Guid", Description="Suite Data Source Instance Id to determine which licensees data to retrieve.", Name="SuiteDataSourceInstanceId")]
public virtual Guid SuiteDataSourceInstanceId { get; set; }
///<summary>
///Batch Call Number.
///</summary>
[ApiMember(DataType="int", Description="Batch Call Number.", Name="BatchNumber")]
public virtual int BatchNumber { get; set; }
///<summary>
///Number of records to retrieve per call.
///</summary>
[ApiMember(DataType="int", Description="Number of records to retrieve per call.", Name="BatchSize")]
public virtual int BatchSize { get; set; }
public virtual bool IgnoreValidation { get; set; }
}
[ApiResponse(Description="Communications Data for synching to Framework")]
public partial class GetCommunicationDataResponse
{
///<summary>
///Bin Row Version of the last update
///</summary>
[ApiMember(DataType="byte[]", Description="Bin Row Version of the last update", Name="BinRowVersion")]
public virtual byte[] BinRowVersion { get; set; }
///<summary>
///Communication Data string (compressed/zipped)
///</summary>
[ApiMember(DataType="string", Description="Communication Data string (compressed/zipped)", Name="Communications")]
public virtual string Communications { get; set; }
public virtual ResponseStatus ResponseStatus { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /csv/reply/GetCommunicationData HTTP/1.1
Host: gatewayframeworkapi.pstpf.com.au
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"BinRowVersion":"AA==","BatchNumber":0,"BatchSize":0,"IgnoreValidation":true}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"BinRowVersion":"AA==","Communications":"String","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}