Pecuario.Backend

<back to all web services

GetProfile

Requires Authentication
The following routes are available for this service:
GET/api/v1/profile
import 'package:servicestack/servicestack.dart';

class Status implements IConvertible
{
    String? message;
    int? statusCode;

    Status({this.message,this.statusCode});
    Status.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'message': message,
        'statusCode': statusCode
    };

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

class BaseResponse implements IConvertible
{
    Status? status;

    BaseResponse({this.status});
    BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        status = JsonConverters.fromJson(json['status'],'Status',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'status': JsonConverters.toJson(status,'Status',context!)
    };

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

class GetProfileResponse extends BaseResponse implements IConvertible
{
    String? firstName;
    String? lastName;
    String? userType;
    String? phoneNumber;
    String? country;

    GetProfileResponse({this.firstName,this.lastName,this.userType,this.phoneNumber,this.country});
    GetProfileResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        firstName = json['firstName'];
        lastName = json['lastName'];
        userType = json['userType'];
        phoneNumber = json['phoneNumber'];
        country = json['country'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'firstName': firstName,
        'lastName': lastName,
        'userType': userType,
        'phoneNumber': phoneNumber,
        'country': country
    });

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

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

    Map<String, dynamic> toJson() => {};
    getTypeName() => "GetProfile";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'pecuario_backend.develsystems.com', types: <String, TypeInfo> {
    'Status': TypeInfo(TypeOf.Class, create:() => Status()),
    'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
    'GetProfileResponse': TypeInfo(TypeOf.Class, create:() => GetProfileResponse()),
    'GetProfile': TypeInfo(TypeOf.Class, create:() => GetProfile()),
});

Dart GetProfile 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.

GET /api/v1/profile HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	firstName: String,
	lastName: String,
	userType: String,
	phoneNumber: String,
	country: String
}