ClubReady Api

<back to all web services

UserAccountRequest

The following routes are available for this service:
PUT/users/{UserId}Update user account info
import 'package:servicestack/servicestack.dart';

class ApiDtoBase implements IConvertible
{
    String? ApiKey;
    int? StoreId;
    int? ChainId;

    ApiDtoBase({this.ApiKey,this.StoreId,this.ChainId});
    ApiDtoBase.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'ApiKey': ApiKey,
        'StoreId': StoreId,
        'ChainId': ChainId
    };

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

class UserAccountRequestDto extends ApiDtoBase implements IConvertible
{
    int? UserId;
    String? FirstName;
    String? LastName;
    String? HomePhone;
    String? CellPhone;
    String? Address1;
    String? City;
    String? State;
    String? Zip;
    String? Email;
    String? Gender;
    DateTime? DateOfBirth;
    String? Username;
    String? ExternalId;
    String? EmergencyContactName;
    String? EmergencyContactPhone;
    String? EmergencyContactType;
    int? ProspectTypeId;

    UserAccountRequestDto({this.UserId,this.FirstName,this.LastName,this.HomePhone,this.CellPhone,this.Address1,this.City,this.State,this.Zip,this.Email,this.Gender,this.DateOfBirth,this.Username,this.ExternalId,this.EmergencyContactName,this.EmergencyContactPhone,this.EmergencyContactType,this.ProspectTypeId});
    UserAccountRequestDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        UserId = json['UserId'];
        FirstName = json['FirstName'];
        LastName = json['LastName'];
        HomePhone = json['HomePhone'];
        CellPhone = json['CellPhone'];
        Address1 = json['Address1'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        Email = json['Email'];
        Gender = json['Gender'];
        DateOfBirth = JsonConverters.fromJson(json['DateOfBirth'],'DateTime',context!);
        Username = json['Username'];
        ExternalId = json['ExternalId'];
        EmergencyContactName = json['EmergencyContactName'];
        EmergencyContactPhone = json['EmergencyContactPhone'];
        EmergencyContactType = json['EmergencyContactType'];
        ProspectTypeId = json['ProspectTypeId'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'UserId': UserId,
        'FirstName': FirstName,
        'LastName': LastName,
        'HomePhone': HomePhone,
        'CellPhone': CellPhone,
        'Address1': Address1,
        'City': City,
        'State': State,
        'Zip': Zip,
        'Email': Email,
        'Gender': Gender,
        'DateOfBirth': JsonConverters.toJson(DateOfBirth,'DateTime',context!),
        'Username': Username,
        'ExternalId': ExternalId,
        'EmergencyContactName': EmergencyContactName,
        'EmergencyContactPhone': EmergencyContactPhone,
        'EmergencyContactType': EmergencyContactType,
        'ProspectTypeId': ProspectTypeId
    });

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

enum RestrictedResourceType
{
    Store,
    Chain,
    User,
    Undefined,
}

class UserAccountRequest extends UserAccountRequestDto implements IRestrictedApiRequest, IConvertible
{
    /**
    * Api Key - grants access to resources
    */
    // @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query")
    String? ApiKey;

    /**
    * 
    */
    // @ApiMember(DataType="integer", Description="", IsRequired=true, Name="UserId", ParameterType="query")
    int? UserId;

    /**
    * StoreId OR ChainId is required
    */
    // @ApiMember(DataType="integer", Description="StoreId OR ChainId is required", Name="StoreId", ParameterType="query")
    int? StoreId;

    /**
    * StoreId OR ChainId is required
    */
    // @ApiMember(DataType="integer", Description="StoreId OR ChainId is required", Name="ChainId", ParameterType="query")
    int? ChainId;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="FirstName", ParameterType="query")
    String? FirstName;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="LastName", ParameterType="query")
    String? LastName;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="HomePhone", ParameterType="query")
    String? HomePhone;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="CellPhone", ParameterType="query")
    String? CellPhone;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="Address1", ParameterType="query")
    String? Address1;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="City", ParameterType="query")
    String? City;

    /**
    * (Format:2 characters; Example:'MO')
    */
    // @ApiMember(DataType="string", Description="(Format:2 characters; Example:'MO')", Name="State", ParameterType="query")
    String? State;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="Zip", ParameterType="query")
    String? Zip;

    /**
    * 
    */
    // @ApiMember(DataType="string", Description="", Name="Email", ParameterType="query")
    String? Email;

    /**
    * Gender (Format:'M'|'F')
    */
    // @ApiMember(DataType="string", Description="Gender (Format:'M'|'F')", Name="Gender", ParameterType="query")
    String? Gender;

    /**
    * Date of Birth (Format:YYYY-MM-DD)
    */
    // @ApiMember(DataType="date", Description="Date of Birth (Format:YYYY-MM-DD)", Name="DateOfBirth", ParameterType="query")
    DateTime? DateOfBirth;

    /**
    * Username should be between 4 and 255 characters long
    */
    // @ApiMember(DataType="string", Description="Username should be between 4 and 255 characters long", Name="Username", ParameterType="query")
    String? Username;

    /**
    * Unique ID for the user from your system. We store internally as ExternalUserId
    */
    // @ApiMember(DataType="string", Description="Unique ID for the user from your system. We store internally as ExternalUserId", Name="ExternalId", ParameterType="query")
    String? ExternalId;

    /**
    * Emergency contact name
    */
    // @ApiMember(DataType="string", Description="Emergency contact name", Name="EmergencyContactName", ParameterType="query")
    String? EmergencyContactName;

    /**
    * Emergency contact phone number
    */
    // @ApiMember(DataType="string", Description="Emergency contact phone number", Name="EmergencyContactPhone", ParameterType="query")
    String? EmergencyContactPhone;

    /**
    * Emergency contact relationship
    */
    // @ApiMember(DataType="string", Description="Emergency contact relationship", Name="EmergencyContactType", ParameterType="query")
    String? EmergencyContactType;

    /**
    * Prospect Type Id
    */
    // @ApiMember(DataType="integer", Description="Prospect Type Id", Name="ProspectTypeId", ParameterType="query")
    int? ProspectTypeId;

    int? RestrictedId;
    RestrictedResourceType? RestrictedResourceType;

    UserAccountRequest({this.ApiKey,this.UserId,this.StoreId,this.ChainId,this.FirstName,this.LastName,this.HomePhone,this.CellPhone,this.Address1,this.City,this.State,this.Zip,this.Email,this.Gender,this.DateOfBirth,this.Username,this.ExternalId,this.EmergencyContactName,this.EmergencyContactPhone,this.EmergencyContactType,this.ProspectTypeId,this.RestrictedId,this.RestrictedResourceType});
    UserAccountRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        ApiKey = json['ApiKey'];
        UserId = json['UserId'];
        StoreId = json['StoreId'];
        ChainId = json['ChainId'];
        FirstName = json['FirstName'];
        LastName = json['LastName'];
        HomePhone = json['HomePhone'];
        CellPhone = json['CellPhone'];
        Address1 = json['Address1'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        Email = json['Email'];
        Gender = json['Gender'];
        DateOfBirth = JsonConverters.fromJson(json['DateOfBirth'],'DateTime',context!);
        Username = json['Username'];
        ExternalId = json['ExternalId'];
        EmergencyContactName = json['EmergencyContactName'];
        EmergencyContactPhone = json['EmergencyContactPhone'];
        EmergencyContactType = json['EmergencyContactType'];
        ProspectTypeId = json['ProspectTypeId'];
        RestrictedId = json['RestrictedId'];
        RestrictedResourceType = JsonConverters.fromJson(json['RestrictedResourceType'],'RestrictedResourceType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'ApiKey': ApiKey,
        'UserId': UserId,
        'StoreId': StoreId,
        'ChainId': ChainId,
        'FirstName': FirstName,
        'LastName': LastName,
        'HomePhone': HomePhone,
        'CellPhone': CellPhone,
        'Address1': Address1,
        'City': City,
        'State': State,
        'Zip': Zip,
        'Email': Email,
        'Gender': Gender,
        'DateOfBirth': JsonConverters.toJson(DateOfBirth,'DateTime',context!),
        'Username': Username,
        'ExternalId': ExternalId,
        'EmergencyContactName': EmergencyContactName,
        'EmergencyContactPhone': EmergencyContactPhone,
        'EmergencyContactType': EmergencyContactType,
        'ProspectTypeId': ProspectTypeId,
        'RestrictedId': RestrictedId,
        'RestrictedResourceType': JsonConverters.toJson(RestrictedResourceType,'RestrictedResourceType',context!)
    });

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

TypeContext _ctx = TypeContext(library: 'www.clubready.com', types: <String, TypeInfo> {
    'ApiDtoBase': TypeInfo(TypeOf.Class, create:() => ApiDtoBase()),
    'UserAccountRequestDto': TypeInfo(TypeOf.Class, create:() => UserAccountRequestDto()),
    'RestrictedResourceType': TypeInfo(TypeOf.Enum, enumValues:RestrictedResourceType.values),
    'UserAccountRequest': TypeInfo(TypeOf.Class, create:() => UserAccountRequest()),
});

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

PUT /users/{UserId} HTTP/1.1 
Host: www.clubready.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ApiKey: String,
	UserId: 0,
	StoreId: 0,
	ChainId: 0,
	FirstName: String,
	LastName: String,
	HomePhone: String,
	CellPhone: String,
	Address1: String,
	City: String,
	State: String,
	Zip: String,
	Email: String,
	Gender: String,
	DateOfBirth: 0001-01-01,
	Username: String,
	ExternalId: String,
	EmergencyContactName: String,
	EmergencyContactPhone: String,
	EmergencyContactType: String,
	ProspectTypeId: 0,
	RestrictedId: 0,
	RestrictedResourceType: User
}