ConsumerApi

<back to all web services

ReferFriendLinkUsedRequest

Consumer
The following routes are available for this service:
POST/share/refer-friend-link-usedA friend referral link was usedValidates the JWT token with the identity of the referring user and returns relevant information.

library ConsumerApi;
import 'package:servicestack/servicestack.dart';

class ReferFriendUser implements IConvertible
{
    String? firstName;
    String? lastName;
    String? profilePhotoUrl;

    ReferFriendUser({this.firstName,this.lastName,this.profilePhotoUrl});
    ReferFriendUser.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        firstName = json['firstName'];
        lastName = json['lastName'];
        profilePhotoUrl = json['profilePhotoUrl'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'firstName': firstName,
        'lastName': lastName,
        'profilePhotoUrl': profilePhotoUrl
    };

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

enum ReferFriendState
{
    Available,
    Awarded,
    CanNotReferYourself,
    YouWereAlreadySignedUp,
    Expired,
}

class ReferFriendLinkUsedResponse implements IConvertible
{
    ReferFriendUser? referringUser;
    ReferFriendState? state;

    ReferFriendLinkUsedResponse({this.referringUser,this.state});
    ReferFriendLinkUsedResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'referringUser': JsonConverters.toJson(referringUser,'ReferFriendUser',context!),
        'state': JsonConverters.toJson(state,'ReferFriendState',context!)
    };

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

class ReferFriendLinkUsedRequest implements IPost, IConvertible
{
    String? referFriendToken;

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

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

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

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

TypeContext _ctx = TypeContext(library: 'ConsumerApi', types: <String, TypeInfo> {
    'ReferFriendUser': TypeInfo(TypeOf.Class, create:() => ReferFriendUser()),
    'ReferFriendState': TypeInfo(TypeOf.Enum, enumValues:ReferFriendState.values),
    'ReferFriendLinkUsedResponse': TypeInfo(TypeOf.Class, create:() => ReferFriendLinkUsedResponse()),
    'ReferFriendLinkUsedRequest': TypeInfo(TypeOf.Class, create:() => ReferFriendLinkUsedRequest()),
});

Dart ReferFriendLinkUsedRequest 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 /share/refer-friend-link-used HTTP/1.1 
Host: unstable-consumer-api.brovs.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

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

{"referringUser":{"firstName":"String","lastName":"String","profilePhotoUrl":"String"},"state":"Available"}