POST | /userconsent |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class Entity implements IEntity, IConvertible
{
String? id;
Entity({this.id});
Entity.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id
};
getTypeName() => "Entity";
TypeContext? context = _ctx;
}
class Consent extends Entity implements IConvertible
{
String? consentDefinitionId;
Map<String,bool?>? consents;
DateTime? consentedDate;
String? lang;
bool? consented;
bool? expired;
Consent({this.consentDefinitionId,this.consents,this.consentedDate,this.lang,this.consented,this.expired});
Consent.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
consentDefinitionId = json['consentDefinitionId'];
consents = JsonConverters.fromJson(json['consents'],'Map<String,bool?>',context!);
consentedDate = JsonConverters.fromJson(json['consentedDate'],'DateTime',context!);
lang = json['lang'];
consented = json['consented'];
expired = json['expired'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'consentDefinitionId': consentDefinitionId,
'consents': JsonConverters.toJson(consents,'Map<String,bool?>',context!),
'consentedDate': JsonConverters.toJson(consentedDate,'DateTime',context!),
'lang': lang,
'consented': consented,
'expired': expired
});
getTypeName() => "Consent";
TypeContext? context = _ctx;
}
class UserConsentPostReq implements IConvertible
{
String? userId;
Consent? consent;
UserConsentPostReq({this.userId,this.consent});
UserConsentPostReq.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userId = json['userId'];
consent = JsonConverters.fromJson(json['consent'],'Consent',context!);
return this;
}
Map<String, dynamic> toJson() => {
'userId': userId,
'consent': JsonConverters.toJson(consent,'Consent',context!)
};
getTypeName() => "UserConsentPostReq";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
'Entity': TypeInfo(TypeOf.Class, create:() => Entity()),
'Consent': TypeInfo(TypeOf.Class, create:() => Consent()),
'Map<String,bool?>': TypeInfo(TypeOf.Class, create:() => Map<String,bool?>()),
'UserConsentPostReq': TypeInfo(TypeOf.Class, create:() => UserConsentPostReq()),
});
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 /userconsent HTTP/1.1
Host: hcbtas-q-albamfs-api.azurewebsites.net
Accept: application/json
Content-Type: application/json
Content-Length: length
{"userId":"String","consent":{"consentDefinitionId":"String","consents":{"String":false},"consentedDate":"0001-01-01T00:00:00.0000000","lang":"String","consented":false,"expired":true,"id":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"consentDefinitionId":"String","consents":{"String":false},"consentedDate":"0001-01-01T00:00:00.0000000","lang":"String","consented":false,"expired":true,"id":"String"}