INTERNAL-Authorization

<back to all web services

AuthorizeToken

Requires Authentication
The following routes are available for this service:
GET,POST/authorizetoken/{Service}/{TokenString}
import 'package:servicestack/servicestack.dart';

class Setting implements IConvertible
{
    String? name;
    String? stringValue;
    bool? booleanValue;
    String? dataType;

    Setting({this.name,this.stringValue,this.booleanValue,this.dataType});
    Setting.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        name = json['name'];
        stringValue = json['stringValue'];
        booleanValue = json['booleanValue'];
        dataType = json['dataType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'name': name,
        'stringValue': stringValue,
        'booleanValue': booleanValue,
        'dataType': dataType
    };

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

class AuthorizeBaseResponse implements IConvertible
{
    bool? isAuthorized;
    List<Setting>? settings;
    int? suggestedStatusCode;
    String? suggestedResponseMessage;
    String? reason;
    String? customerId;

    AuthorizeBaseResponse({this.isAuthorized,this.settings,this.suggestedStatusCode,this.suggestedResponseMessage,this.reason,this.customerId});
    AuthorizeBaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        isAuthorized = json['isAuthorized'];
        settings = JsonConverters.fromJson(json['settings'],'List<Setting>',context!);
        suggestedStatusCode = json['suggestedStatusCode'];
        suggestedResponseMessage = json['suggestedResponseMessage'];
        reason = json['reason'];
        customerId = json['customerId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'isAuthorized': isAuthorized,
        'settings': JsonConverters.toJson(settings,'List<Setting>',context!),
        'suggestedStatusCode': suggestedStatusCode,
        'suggestedResponseMessage': suggestedResponseMessage,
        'reason': reason,
        'customerId': customerId
    };

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

class AuthorizeTokenResponse extends AuthorizeBaseResponse implements IConvertible
{
    AuthorizeTokenResponse();
    AuthorizeTokenResponse.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "AuthorizeTokenResponse";
    TypeContext? context = _ctx;
}

class AuthorizeToken implements IAuthorizeToken, IConvertible
{
    // @ApiMember(IsRequired=true, ParameterType="path")
    String? tokenString;

    // @ApiMember(IsRequired=true, ParameterType="path")
    String? service;

    AuthorizeToken({this.tokenString,this.service});
    AuthorizeToken.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        tokenString = json['tokenString'];
        service = json['service'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'tokenString': tokenString,
        'service': service
    };

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

TypeContext _ctx = TypeContext(library: 'nkapi_sgepz3_auth.azurewebsites.net', types: <String, TypeInfo> {
    'Setting': TypeInfo(TypeOf.Class, create:() => Setting()),
    'AuthorizeBaseResponse': TypeInfo(TypeOf.Class, create:() => AuthorizeBaseResponse()),
    'List<Setting>': TypeInfo(TypeOf.Class, create:() => <Setting>[]),
    'AuthorizeTokenResponse': TypeInfo(TypeOf.Class, create:() => AuthorizeTokenResponse()),
    'AuthorizeToken': TypeInfo(TypeOf.Class, create:() => AuthorizeToken()),
});

Dart AuthorizeToken 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 /authorizetoken/{Service}/{TokenString} HTTP/1.1 
Host: nkapi-sgepz3-auth.azurewebsites.net 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"tokenString":"String","service":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"isAuthorized":false,"settings":[{"name":"String","stringValue":"String","booleanValue":false,"dataType":"String"}],"suggestedStatusCode":0,"suggestedResponseMessage":"String","reason":"String"}