Trendsic Platform Service

<back to all web services

CoverageSwapRespondRequest

The following routes are available for this service:
POST/v1/coverage/swap/{Token}/respond
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class CoverageSwapSideInfo implements IConvertible
{
    String? Name;
    String? DateText;
    String? JobName;
    bool? Consented;

    CoverageSwapSideInfo({this.Name,this.DateText,this.JobName,this.Consented});
    CoverageSwapSideInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Name = json['Name'];
        DateText = json['DateText'];
        JobName = json['JobName'];
        Consented = json['Consented'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Name': Name,
        'DateText': DateText,
        'JobName': JobName,
        'Consented': Consented
    };

    getTypeName() => "CoverageSwapSideInfo";
    TypeContext? context = _ctx;
}

class CoverageSwapViewResponse implements IConvertible
{
    String? State;
    CoverageSwapSideInfo? You;
    CoverageSwapSideInfo? Them;
    bool? Directed;
    String? WithdrawnBy;
    ResponseStatus? ResponseStatus;

    CoverageSwapViewResponse({this.State,this.You,this.Them,this.Directed,this.WithdrawnBy,this.ResponseStatus});
    CoverageSwapViewResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        State = json['State'];
        You = JsonConverters.fromJson(json['You'],'CoverageSwapSideInfo',context!);
        Them = JsonConverters.fromJson(json['Them'],'CoverageSwapSideInfo',context!);
        Directed = json['Directed'];
        WithdrawnBy = json['WithdrawnBy'];
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'State': State,
        'You': JsonConverters.toJson(You,'CoverageSwapSideInfo',context!),
        'Them': JsonConverters.toJson(Them,'CoverageSwapSideInfo',context!),
        'Directed': Directed,
        'WithdrawnBy': WithdrawnBy,
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "CoverageSwapViewResponse";
    TypeContext? context = _ctx;
}

class CoverageSwapRespondRequest implements IConvertible
{
    String? Token;
    String? Action;

    CoverageSwapRespondRequest({this.Token,this.Action});
    CoverageSwapRespondRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Token = json['Token'];
        Action = json['Action'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Token': Token,
        'Action': Action
    };

    getTypeName() => "CoverageSwapRespondRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'CoverageSwapSideInfo': TypeInfo(TypeOf.Class, create:() => CoverageSwapSideInfo()),
    'CoverageSwapViewResponse': TypeInfo(TypeOf.Class, create:() => CoverageSwapViewResponse()),
    'CoverageSwapRespondRequest': TypeInfo(TypeOf.Class, create:() => CoverageSwapRespondRequest()),
});

Dart CoverageSwapRespondRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/coverage/swap/{Token}/respond HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Token: String,
	Action: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	State: String,
	You: 
	{
		Name: String,
		DateText: String,
		JobName: String,
		Consented: False
	},
	Them: 
	{
		Name: String,
		DateText: String,
		JobName: String,
		Consented: False
	},
	Directed: False,
	WithdrawnBy: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}