Mercedes.Auth.API

<back to all web services

Authorisation

The following routes are available for this service:
POST/v1/authorisation
import 'package:servicestack/servicestack.dart';

class AuthorisationResponse implements IConvertible
{
    String? status;
    String? GasUserId;
    String? Application;
    List<String>? Roles;
    List<String>? GSSNRetailerIds;
    String? DefaultGSSNRetailerId;
    String? DefaultVehicleType;
    String? DefaultRole;
    int? DefaultRoleCount;

    AuthorisationResponse({this.status,this.GasUserId,this.Application,this.Roles,this.GSSNRetailerIds,this.DefaultGSSNRetailerId,this.DefaultVehicleType,this.DefaultRole,this.DefaultRoleCount});
    AuthorisationResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        status = json['status'];
        GasUserId = json['GasUserId'];
        Application = json['Application'];
        Roles = JsonConverters.fromJson(json['Roles'],'List<String>',context!);
        GSSNRetailerIds = JsonConverters.fromJson(json['GSSNRetailerIds'],'List<String>',context!);
        DefaultGSSNRetailerId = json['DefaultGSSNRetailerId'];
        DefaultVehicleType = json['DefaultVehicleType'];
        DefaultRole = json['DefaultRole'];
        DefaultRoleCount = json['DefaultRoleCount'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'status': status,
        'GasUserId': GasUserId,
        'Application': Application,
        'Roles': JsonConverters.toJson(Roles,'List<String>',context!),
        'GSSNRetailerIds': JsonConverters.toJson(GSSNRetailerIds,'List<String>',context!),
        'DefaultGSSNRetailerId': DefaultGSSNRetailerId,
        'DefaultVehicleType': DefaultVehicleType,
        'DefaultRole': DefaultRole,
        'DefaultRoleCount': DefaultRoleCount
    };

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

class Authorisation implements IConvertible
{
    String? GasUserId;
    List<String>? ApplicationDotRole;
    List<String>? GEMSOutletId;
    String? Application;

    Authorisation({this.GasUserId,this.ApplicationDotRole,this.GEMSOutletId,this.Application});
    Authorisation.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        GasUserId = json['GasUserId'];
        ApplicationDotRole = JsonConverters.fromJson(json['ApplicationDotRole'],'List<String>',context!);
        GEMSOutletId = JsonConverters.fromJson(json['GEMSOutletId'],'List<String>',context!);
        Application = json['Application'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'GasUserId': GasUserId,
        'ApplicationDotRole': JsonConverters.toJson(ApplicationDotRole,'List<String>',context!),
        'GEMSOutletId': JsonConverters.toJson(GEMSOutletId,'List<String>',context!),
        'Application': Application
    };

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

TypeContext _ctx = TypeContext(library: 'prod_api_auth_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
    'AuthorisationResponse': TypeInfo(TypeOf.Class, create:() => AuthorisationResponse()),
    'Authorisation': TypeInfo(TypeOf.Class, create:() => Authorisation()),
});

Dart Authorisation DTOs

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

HTTP + OTHER

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

POST /v1/authorisation HTTP/1.1 
Host: prod-api-auth-mb-dhc.rapp-customers.co.uk 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"GasUserId":"String","ApplicationDotRole":["String"],"GEMSOutletId":["String"],"Application":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"status":"String","GasUserId":"String","Application":"String","Roles":["String"],"GSSNRetailerIds":["String"],"DefaultGSSNRetailerId":"String","DefaultVehicleType":"String","DefaultRole":"String","DefaultRoleCount":0}