Required role: | User |
PATCH | /app/user-info |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class AppUserInfo implements IConvertible
{
/**
* The user's first name
*/
// @ApiMember(Description="The user's first name")
String? firstName;
/**
* The user's last name
*/
// @ApiMember(Description="The user's last name")
String? lastName;
/**
* Shortcut to the user's full name
*/
// @ApiMember(Description="Shortcut to the user's full name")
String? name;
/**
* The URL to the user's avatar
*/
// @ApiMember(Description="The URL to the user's avatar")
String? avatarUrl;
AppUserInfo({this.firstName,this.lastName,this.name,this.avatarUrl});
AppUserInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
name = json['name'];
avatarUrl = json['avatarUrl'];
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName,
'name': name,
'avatarUrl': avatarUrl
};
getTypeName() => "AppUserInfo";
TypeContext? context = _ctx;
}
/**
* Updates the user's info
*/
// @Api(Description="Updates the user's info")
class UpdateUserInfo implements IPatch, IConvertible
{
/**
* The new first name
*/
// @ApiMember(Description="The new first name")
String? firstName;
/**
* The new last name
*/
// @ApiMember(Description="The new last name")
String? lastName;
UpdateUserInfo({this.firstName,this.lastName});
UpdateUserInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
firstName = json['firstName'];
lastName = json['lastName'];
return this;
}
Map<String, dynamic> toJson() => {
'firstName': firstName,
'lastName': lastName
};
getTypeName() => "UpdateUserInfo";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'AppUserInfo': TypeInfo(TypeOf.Class, create:() => AppUserInfo()),
'UpdateUserInfo': TypeInfo(TypeOf.Class, create:() => UpdateUserInfo()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PATCH /app/user-info HTTP/1.1
Host: team.evovoice.io
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"firstName":"String","lastName":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"firstName":"String","lastName":"String","name":"String","avatarUrl":"String"}