GET,POST | /authorizeuser/{Service}/{Profile} |
---|
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 AuthorizeUserResponse extends AuthorizeBaseResponse implements IAuthorizeUserResponse, IConvertible
{
String? userObjectId;
String? userTenant;
String? userTenantId;
AuthorizeUserResponse({this.userObjectId,this.userTenant,this.userTenantId});
AuthorizeUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
userObjectId = json['userObjectId'];
userTenant = json['userTenant'];
userTenantId = json['userTenantId'];
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'userObjectId': userObjectId,
'userTenant': userTenant,
'userTenantId': userTenantId
});
getTypeName() => "AuthorizeUserResponse";
TypeContext? context = _ctx;
}
class AuthorizeUser implements IAuthorizeUser, IConvertible
{
// @ApiMember(IsRequired=true)
String? bearerToken;
// @ApiMember(IsRequired=true, ParameterType="path")
String? profile;
// @ApiMember(IsRequired=true, ParameterType="path")
String? service;
// @ApiMember(Name="X-WAAPI-CONTEXT", ParameterType="header")
String? customerContext;
AuthorizeUser({this.bearerToken,this.profile,this.service,this.customerContext});
AuthorizeUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
bearerToken = json['bearerToken'];
profile = json['profile'];
service = json['service'];
customerContext = json['customerContext'];
return this;
}
Map<String, dynamic> toJson() => {
'bearerToken': bearerToken,
'profile': profile,
'service': service,
'customerContext': customerContext
};
getTypeName() => "AuthorizeUser";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'nkapi_sgepz3_auth_r1.azurewebsites.net', types: <String, TypeInfo> {
'Setting': TypeInfo(TypeOf.Class, create:() => Setting()),
'AuthorizeBaseResponse': TypeInfo(TypeOf.Class, create:() => AuthorizeBaseResponse()),
'List<Setting>': TypeInfo(TypeOf.Class, create:() => <Setting>[]),
'AuthorizeUserResponse': TypeInfo(TypeOf.Class, create:() => AuthorizeUserResponse()),
'AuthorizeUser': TypeInfo(TypeOf.Class, create:() => AuthorizeUser()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /authorizeuser/{Service}/{Profile} HTTP/1.1
Host: nkapi-sgepz3-auth-r1.azurewebsites.net
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"bearerToken":"String","profile":"String","service":"String","customerContext":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"userTenant":"String","userTenantId":"String","isAuthorized":false,"settings":[{"name":"String","stringValue":"String","booleanValue":false,"dataType":"String"}],"suggestedStatusCode":0,"suggestedResponseMessage":"String","reason":"String"}