GET | /userconsent/{UserId}/{Country} | ||
---|---|---|---|
GET | /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 UserConsentGetReq implements IConvertible
{
String? userId;
String? country;
UserConsentGetReq({this.userId,this.country});
UserConsentGetReq.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userId = json['userId'];
country = json['country'];
return this;
}
Map<String, dynamic> toJson() => {
'userId': userId,
'country': country
};
getTypeName() => "UserConsentGetReq";
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?>()),
'UserConsentGetReq': TypeInfo(TypeOf.Class, create:() => UserConsentGetReq()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /userconsent/{UserId}/{Country} HTTP/1.1 Host: hcbtas-q-albamfs-api.azurewebsites.net Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <Consent xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.Model"> <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id> <ConsentDefinitionId>String</ConsentDefinitionId> <ConsentedDate>0001-01-01T00:00:00</ConsentedDate> <Consents xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:KeyValueOfstringboolean> <d2p1:Key>String</d2p1:Key> <d2p1:Value>false</d2p1:Value> </d2p1:KeyValueOfstringboolean> </Consents> <Lang>String</Lang> </Consent>