AlbaApi

<back to all web services

UserConsentPostReq

The following routes are available for this service:
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()),
});

Dart UserConsentPostReq DTOs

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

HTTP + XML

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/xml
Content-Type: application/xml
Content-Length: length

<UserConsentPostReq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AlbaApi.ServiceModel">
  <Consent xmlns:d2p1="http://schemas.datacontract.org/2004/07/AlbaApi.Model">
    <Id xmlns="http://schemas.datacontract.org/2004/07/TasSyd.Model.Base">String</Id>
    <d2p1:ConsentDefinitionId>String</d2p1:ConsentDefinitionId>
    <d2p1:ConsentedDate>0001-01-01T00:00:00</d2p1:ConsentedDate>
    <d2p1:Consents xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringboolean>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>false</d3p1:Value>
      </d3p1:KeyValueOfstringboolean>
    </d2p1:Consents>
    <d2p1:Lang>String</d2p1:Lang>
  </Consent>
  <UserId>String</UserId>
</UserConsentPostReq>
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>