ServiceStack Home (Live)

<back to all web services

AdminChangeEmail

Admin
Requires Authentication
Required role:Admin
The following routes are available for this service:
All Verbs/AdminChangeEmail
import 'package:servicestack/servicestack.dart';

// @DataContract
class StringResponse implements IMeta, IConvertible
{
    // @DataMember(Order=1)
    String? result;

    // @DataMember(Order=2)
    Map<String,String?>? meta;

    // @DataMember(Order=3)
    ResponseStatus? responseStatus;

    StringResponse({this.result,this.meta,this.responseStatus});
    StringResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        result = json['result'];
        meta = JsonConverters.toStringMap(json['meta']);
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'result': result,
        'meta': meta,
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

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

// @ValidateRequest(Validator="IsAdmin")
class AdminChangeEmail implements IPost, IConvertible
{
    // @Validate(Validator="NotEmpty")
    String? from;

    // @Validate(Validator="NotEmpty")
    String? to;

    AdminChangeEmail({this.from,this.to});
    AdminChangeEmail.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'from': from,
        'to': to
    };

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

TypeContext _ctx = TypeContext(library: 'account.servicestack.net', types: <String, TypeInfo> {
    'AdminChangeEmail': TypeInfo(TypeOf.Class, create:() => AdminChangeEmail()),
});

Dart AdminChangeEmail DTOs

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

HTTP + JSV

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

POST /AdminChangeEmail HTTP/1.1 
Host: account.servicestack.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	from: String,
	to: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	result: String,
	meta: 
	{
		String: String
	},
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}