AlbaApi

<back to all web services

UserConsentGetReq

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

Dart UserConsentGetReq DTOs

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

HTTP + JSON

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/json
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"}